在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'
解決方法:
- 更新androidStudio Support repository,其中有一項就是ConstraintLayout for Android
- 查看已安裝的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,解決問題!