Android 运行时错误 ConstraintSet, unable to find attribute android:elevation

来源:互联网 发布:logstash apache日志 编辑:程序博客网 时间:2024/06/05 21:05

刚才在修改项目时新建了Activity,其自动生成的布局文件的根布局为Android.support.constraint.ConstraintLayout,在项目里用不到就直接删除了,更改为LinearLayout,结果运行报错


以上错误第一次遇到根据错误的查找了半天,结果打开Build.greadle文件一看,原来是引用了

compile 'com.android.support.constraint:constraint-layout:1.0.2'
如果项目中没有使用ConstraintLayout布局,还引入了以上包,就会报错。
解决办法:
如果不使用ConstraintLayout布局,就直接将conmpile引入的包直接删掉就OK了

阅读全文
0 0