您的位置:首页 > 移动开发 > Android开发

Android运行时报错:In <declare-styleable> ConstraintSet

2017-07-25 14:45 239 查看
最近新建项目时,用的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引入的包直接删掉
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐