1

Is anyone familiar with the below issue.

/Users/macpurple8/Desktop/Minto_Purple/Clients/Sanghi/Sanghi 03 03 7pm/app/src/main/res/values/colors.xml
Error:(2) Attribute "spinnerStyle" has already been defined

Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Users/macpurple8/Desktop/adt-bundle-mac-x86_64-20140702/sdk/build-tools/23.0.1/aapt'' finished with non-zero exit value 1

My project was working fine. The issue arised when I added a new fragment. Any idea, what could be the issue??

Update

Attaching the codes...

these are the libraries used..

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile project(':purpleb2b')
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'
    compile 'com.android.support:support-v4:23.1.1'
    compile 'com.jakewharton:butterknife:7.0.1'
    compile 'com.android.support:cardview-v7:23.1.1'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.thomashaertel:multispinner:0.1.1'
    compile 'com.itextpdf.tool:xmlworker:5.5.8'
    compile 'com.google.android.gms:play-services-gcm:8.4.0'

}

'purpletb2b' is a custom library. Its dependencies are as follows

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.0.1'
    compile 'de.greenrobot:greendao:2.0.0'
    compile 'com.google.code.gson:gson:2.4'
    compile 'me.neavo:volley:2014.12.09'
    compile 'org.apache.httpcomponents:httpmime:4.3.1'
    compile 'org.apache.httpcomponents:httpcore:4.3.1'
    compile 'itext:itext:1.3.1'
    compile 'org.json:json:20151123'
    compile 'com.opencsv:opencsv:3.6'
    compile 'org.apache.httpcomponents:httpclient:4.5'
}

Also in my style.xml I havent used "spinnerStyle". I am not sure whether any of the libraries listed are using it. Please suggest a solution.

Minto
  • 2,004
  • 1
  • 15
  • 19

3 Answers3

1

The error is likely to be produced if there are more than one definition for 'SpinnerStyle' in your project. Check if you have used any libraries that may define the same.

Unnikrishnan M R
  • 224
  • 2
  • 11
0

Check in attrs.xml in values

 <declare-styleable name="a">
     <attr name="spinnerStyle" format="string" />  // same attr name
 </declare-styleable>
 <declare-styleable name="b">
     <attr name="spinnerStyle" format="string" />  // same attr name
 </declare-styleable>

above code throws a similar error. for best practice format code as below

<declare-styleable name="a">
      <attr name="a_spinnerStyle" format="string" />  // same attr name
</declare-styleable>

Similar can be seen in any XML file under res.

Ravi Gadipudi
  • 1,446
  • 1
  • 17
  • 30
0

The library 'com.thomashaertel:multispinner:0.1.1' defines the attribute <item name="spinnerStyle"> as does one of the other libraries you are including.

This attribute is also defined in the latest android support libraries (24) which causes the same conflict. The best option to work around this is to submit a pull request for the multispinner library to change the name of this attribute, or include the source code in your project and make the change yourself.

BrentM
  • 5,671
  • 3
  • 31
  • 38