android - Gradle build fails with duplicates when adding google-api-client -


i adding code project requires google-api-client, when add via gradle dependency, duplicate error.

here gradle dependency list

dependencies {     compile 'com.adobe.creativesdk:image:4.0.0'     // compile project(':showcaseview')     compile project(':facebook')     compile project(':swipemenulistview')     compile 'com.android.support:multidex:1.0.0'     compile 'com.android.support:design:22.2.0'     compile 'com.google.code.gson:gson:2.3.1'     compile 'com.google.android.gms:play-services:7.5.+'     compile 'com.google.android.gms:play-services-appinvite:7.5.0'     compile 'org.apache.httpcomponents:httpmime:4.3.6'     compile 'org.apache.httpcomponents:httpcore:4.3.3'     compile 'commons-codec:commons-codec:1.9'     compile 'commons-io:commons-io:2.4'     compile 'com.google.gdata:core:1.47.1'     compile files('libs/tape-1.1.0.jar')     compile files('libs/gdata-photos-meta-2.0.jar')      compile 'com.google.api-client:google-api-client:1.20.0'     // compile 'com.google.http-client:google-http-client:1.20.0'     // compile files('libs/android-oauth-client-0.4.5.jar') } 

here error receive

execution failed task ':floomit:packagealldebugclassesformultidex'. > java.util.zip.zipexception: duplicate entry: com/google/common/collect/package-info.class 

if remove google-api-client line dependency list, error goes away.

any suggestions on how proceed?

that because com.google.api-client:google-api-client depends on com.google.guava:guava-jdk5 com.google.gdata:core depends on com.google.guava:guava. jdk5 split unfortunate.

gradle allows override dependencies. try replacing gdata dependency like:

compile('com.google.gdata:core:1.47.1') {     exclude group: 'com.google.guava', module: 'guava' } 

Comments

Popular posts from this blog

python - Healpy: From Data to Healpix map -

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -