每次我使用编译'com.androidplot:androidplot-core:1.0.0'同步gradle我有一个已经定义的错误
The Error
Error:(309) Attribute "title" has already been defined
Error:(316) Attribute "titleTextColor" has already been defined
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\Guren\AppData\Local\Android\sdk\build-tools\23.0.2\aapt.exe'' finished with non-zero exit value 1
My Dependencies
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
// compile 'com.android.support:recyclerview-v7:23.4.0'
// compile 'com.android.support:cardview-v7:23.4.0'
//Material Acr Menu
compile 'com.androidplot:androidplot-core:1.0.0'
// ListView
// compile 'com.baoyz.swipemenulistview:library:1.3.0'
// MathView
compile 'io.github.kexanie.library:MathView:0.0.6'
// Tesseract - OCR
compile project(':libraries:tess-two')
// GraphView
// compile files('libs/GraphView-4.1.0.jar')
}
答案 0 :(得分:7)
我能够通过首先创建一个使用Androidplot的示例项目然后创建我自己的attrs.xml来定义具有title属性的样式来重现该问题。 This issue report提供了有关正在发生的事情的背景信息。
很可能你的应用程序或你的其他一个依赖项在其attrs.xml中定义了样式,它重用了一些或多个相同的attr名称作为androidplot。
似乎至少有两种解决方案:
1 - 删除定义重复属性的其中一个依赖项。 (不是一个非常好的解决方案)
-OR -
2 - 将构建工具更新为24.0.2:
android {
buildToolsVersion '24.0.2'
...
}
遗憾的是,鉴于如何应用可定制的命名空间,这是一个问题,但至少它似乎在最新的构建工具中得到了解决。