ConstraintLayout报错问题-找不到资源

在AndroidStudio中引入 ConstraintLayout后,编译报错:

Error:(80) No resource identifier found for attribute 'layout_constraintVertical_chainStyle' in package 

build.gradle中的配置ConstraintLayout如下

    compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'

解决方法:

  1. 更新androidStudio Support repository,其中有一项就是ConstraintLayout for Android
  2. 查看已安装的ConstraintLayout版本
    路径:sdk/extras/m2repository/com/android/support/constraint/constraint-layout
    我安装的版本有两个1.0.0-alpha7 和 1.0.2

因此用 1.0.2 版本替换 1.0.0-alpha7

compile 'com.android.support.constraint:constraint-layout:1.0.2'

随后sync project,解决问题!

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容