Already Defined Error when building with gradle

社会主义新天地 提交于 2019-12-31 07:41:40

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!