添加android支持设计库后出现Gradle错误

epo*_*ool 5 android android-support-library android-design-library

添加compile 'com.android.support:design:22.2.0'到我的gradle文件后,我收到此错误: .../app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.2.0/res/values/values.xml显示此消息Error:(1) Attribute "insetForeground" has already been defined.

我在build.gradle文件中有这个:`

compile 'com.android.support:design:22.2.0'
compile 'com.android.support:cardview-v7:22.2.0'
compile 'com.android.support:recyclerview-v7:22.2.0'
compile 'com.google.android.gms:play-services-base:7.5.0'
compile 'com.google.android.gms:play-services-location:7.5.0'
compile 'com.google.android.gms:play-services-gcm:7.5.0'
compile 'com.google.android.gms:play-services-maps:7.5.0'
Run Code Online (Sandbox Code Playgroud)

我已经省略AppCompat Support Library了这篇文章.

我该如何解决?

Hsi*_*eng 11

您可能ScrimInsetsFrameLayout在项目中使用导航抽屉设计.删除attr中的这些属性资源,并使用NavigationView替换抽屉布局.

  • 而我刚刚发现Google将"ScrimInsetsFrameLayout"设置为[在Android设计支持库中] [https://android.googlesource.com/platform/frameworks/support/+/master/design/src/android/support/design/内部/ ScrimInsetsFrameLayout.java?autodive = 0%2F%2F%2F). (5认同)