user5808462
user5808462

Reputation:

Duplicate jar file Error

Error

FAILURE: Build failed with an exception.

I added the following dependencies

dependencies {
//compile 'com.google.android.gms:play-services:+'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.google.android.gms:play-services-location:8.3.0'
compile files('libs/twitter4j-core-4.0.2.jar')
compile project(':devsmartAndroid')
compile project(':FacebookSDK')
compile project(':libPhotoView')
compile files('libs/android-support-v4.jar')
compile project(':library')
//compile 'com.google.android.gms:play-services-gcm:7.5.0'
//compile 'com.google.android.gms:play-services-analytics:7.5.0'
compile files('libs/gcm.jar')
compile files('libs/libGoogleAnalyticsServices.jar')  }

Upvotes: 1

Views: 1540

Answers (2)

IntelliJ Amiya
IntelliJ Amiya

Reputation: 75798

:app:transformClassesWithJarMergingForDebug'. com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/analytics/internal/Command.class

Problem is here

 compile 'com.google.android.gms:play-services:8.4.0'
 compile 'com.google.android.gms:play-services-location:8.3.0'

You should call one Finally

compile 'com.google.android.gms:play-services:8.4.0'

Edit

I assume libGoogleAnalyticsServices.jar creating Duplicate entry .

So you can comment just this jar

compile files('libs/libGoogleAnalyticsServices.jar')

Upvotes: 2

Maheshwar Ligade
Maheshwar Ligade

Reputation: 6855

In your Gradle file there are two dependencies

compile 'com.google.android.gms:play-services:8.4.0'

compile 'com.google.android.gms:play-services-location:8.3.0'

Instead of using both use only one

compile 'com.google.android.gms:play-services:8.4.0'

Because the play-services package is consolidated with all play services. otherwise add separately each one such as GCM,GA,etc

Upvotes: 0

Related Questions