最近新建项目时,用的studio自动创建Activity,其自动生成根布局为android.support.constraint.ConstraintLayout,因为用着不适应,随手改成了RelativeLayout,没想到项目就这样运行不起来了,报的错是
In <declare-styleable> ConstraintSet,unable to find attribute android:elevation
Execution faild for task
>com.android.ide.common.process.ProcessException:Failed to execute aapt
BUILD FAILED
郁闷了半天,原来是自动创建ConstraintLayout布局时,项目build.greadle里自动引入了
compile 'com.android.support.constraint:constraint-layout:1.0.2'
意思是建议根布局使用ConstraintLayout,这里有两个办法:
1、直接将根布局替换为ConstraintLayout
2、将compile引入的包直接删掉