android - 我无法在android studio中添加此库:编译 'com.android.support:design:24.0.0'

标签 android gradle

当我在依赖项中添加该库compile 'com.android.support:design:24.0.0'时,出现以下错误:

Information:Gradle tasks [clean, :app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:compileDebugSources, :app:compileDebugAndroidTestSources, :app:compileDebugUnitTestSources]
Error:(253) Original attribute defined here.
C:\Users\Jamshidi\AndroidStudioProjects\School\School\app\build\intermediates\res\merged\debug\values\values.xml
Error:(257) Attribute "rippleColor" already defined with incompatible format.
Error:(257) Attribute "rippleColor" already defined with incompatible format.
Error:(253) Original attribute defined here.
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
Information:BUILD FAILED
Information:Total time: 26.882 secs
Information:5 errors
Information:0 warnings
Information:See complete output in console

我该如何解决:

我的build.gradle文件包含以下内容:
 dependencies {
   compile fileTree(include: ['*.jar'], dir: 'libs')
   testCompile 'junit:junit:4.12'
   compile 'com.android.support:appcompat-v7:24.0.0'
   compile 'com.android.support:cardview-v7:24.0.0'
   compile 'com.wrapp.floatlabelededittext:library:0.0.6'
   compile 'com.github.navasmdc:MaterialDesign:1.5@aar'
   compile 'com.squareup.picasso:picasso:2.3.2'
   compile 'com.nineoldandroids:library:2.4.0'
   compile 'com.daimajia.slider:library:1.1.5@aar'
   compile 'com.android.support:support-v4:24.1.0'
   compile 'com.baoyz.pullrefreshlayout:library:1.2.0'
   compile 'com.android.support:design:24.0.0'

最佳答案

我猜你有这个错误,因为'com.android.support:design:22.2.0''com.github.navasmdc:MaterialDesign:1.5@aar'库具有相同的属性rippleColor
要解决此冲突,您可以:

  • 克隆一个库(com.android.support:design:22.2.0com.github.navasmdc:MaterialDesign:1.5@aar),重命名属性,导入到您的项目中。
  • thisthis或其他替换第三方库。
  • 关于android - 我无法在android studio中添加此库:编译 'com.android.support:design:24.0.0',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40128409/

    相关文章:

    java - 使用sdkman安装后如何设置gradle路径

    android - 如何以 RectangleF 为边界裁剪位图

    jquery - Dreamweaver CS5.5 中的 Phonegap

    android - 如何让左边的drawable粘在文本上

    java - onProgressUpdate 未运行

    android - 未找到 protoc-gen-javanano

    java - 是否有可能拥有 native android 代码?

    gradle - 使用实现项目时,可传递引用不起作用

    java - Gradle 运行 jar 时出现 NoClassDefFoundError

    react-native - React Native 构建发布成功,但我得到 app-release-unsigned.apk