问题
I imported an old project from ANT to Gradle. I included all libraries and tride build but i have problem:
E:\gradle\DriverClient\app\build\intermediates\exploded-aar\com.google.android.gms\play-services-wallet\7.8.0\res\values\wallet_colors.xml
Error:(2) Attribute "titleTextStyle" has already been defined
Error:(2) Attribute "subtitleTextStyle" has already been defined
Error:(2) Attribute "divider" has already been defined
Error:(2) Attribute "background" has already been defined
Error:(2) Attribute "backgroundSplit" has already been defined
Error:(2) Attribute "navigationMode" has already been defined
Error:(2) Attribute "displayOptions" has already been defined
.............................
I do not understand what is wrong. Here are my Gradle dependencies -
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
compile 'com.larswerkman:HoloColorPicker:1.5'
compile 'com.google.android.gms:play-services:7.8.0'
compile 'org.jsoup:jsoup:1.8.3'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.4'
}
回答1:
You can't use appcompat library and ActionBarSherlock together because they are using the same attrs.
I suggest you using the appcompat library since abs was deprecated about two years ago,not updated and out of mantenaince.
回答2:
Try to remove
compile 'com.google.android.gms:play-services:7.8.0'
Hope it helps :)
来源:https://stackoverflow.com/questions/32390618/already-defined-error-when-building-with-gradle