Samuel Rodriguez Samuel Rodriguez - 1 year ago 128
Android Question

Attribute "title" has already been define when have android plot dependencies 1.0.0

every time i sync the gradle with compile 'com.androidplot:androidplot-core:1.0.0' i have an error of has already defined

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'.
> 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 ''
// compile ''
// compile ''
//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')


Answer Source

I was able to reproduce the problem by first creating a sample project that uses Androidplot and then creating my own attrs.xml that defines a styleable with a title attribute. This issue report provides some context on what's happening.

Most likely either your app or one of your other dependencies defines styleables in it's attrs.xml that reuse some one or more of the same attr names as androidplot.

There appears to be at least two solutions:

1 - Remove one of the dependencies that defines the duplicate attribute. (Not a very great solution)


2 - Update your build tools to 24.0.2:

android {
    buildToolsVersion '24.0.2'

It's unfortunate that this is an issue at all given how styleable namespaces are applied, but at least it seems to be resolved in the latest build tools.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download