Java.util.zip.ZipException: duplicate entry: com / google / android / gms / internal / zzbq.class

I am new to Android. I am currently working in an Android application, and when I try to run the application, this error occurs.

I researched, but cannot solve this error.

error

build.gradle

apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.2" defaultConfig { multiDexEnabled true applicationId "com.tutorialsbuzz.androidfacebook" minSdkVersion 15 targetSdkVersion 23 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } repositories { mavenCentral() } dependencies { compile 'com.android.support:multidex:1.0.0' compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:support-v4:23.0.1' compile 'com.android.support:design:23.0.1' compile 'com.facebook.android:facebook-android-sdk:4.7.0' compile 'com.squareup.picasso:picasso:2.4.0' compile 'com.google.android.gms:play-services-auth:9.2.1' compile 'com.google.android.gms:play-services:7.5.0' } 

thanks in advance

+5
source share
4 answers

The reason for this may be that you have two different versions for gms. Also, if you have included the full package, then there is no need to include the second com.google.android.gms compiler: play-services: 7.5.0 '' If you only need auth services from Google, then do not include the full package will exceed 65 thousand. methods, and the likelihood of duplication will be there. Turn on this

compile 'com.google.android.gms: play-services-auth: 9.4.0'

and remove from your code

compile 'com.google.android.gms: play-services-auth: 9.2.1' compile 'Com.google.android.gms: docking services: 7.5.0'

Run it and let me know once.

+3
source

In my case, it is because

 compile 'com.facebook.android:audience-network-sdk:4.+' 

I change it to this:

  compile ('com.facebook.android:audience-network-sdk:4.+'){ exclude group:"com.google.android.gms" } 

More problems!

+9
source

If you are using Firebase, you should read my solution. In my case, I developed a new application. This new app has ads, so I put compile 'com.google.firebase:firebase-ads:11.0.4' BEFORE compile 'com.google.firebase:firebase-core:11.0.4' .

But either you have to put all AFTER firebase-core , or version number 11.0.4 , which should be the same on all firebase modules you use.

+1
source

Exclude com.google.android.gms from the damaged package that worked to create the project for me, but, unfortunately, the application will crash during initialization. The solution for me was to update all firebase dependencies from 11.6.0 to 11.8.0 , 11.8.0 .:

 - compile "com.google.android.gms:play-services-base:11.6.0" - compile "com.google.firebase:firebase-core:11.6.0" - compile "com.google.firebase:firebase-messaging:11.6.0" - compile "com.google.firebase:firebase-analytics:11.6.0" - compile "com.google.firebase:firebase-ads:11.6.0" + compile "com.google.android.gms:play-services-base:11.8.0" + compile "com.google.firebase:firebase-core:11.8.0" + compile "com.google.firebase:firebase-messaging:11.8.0" + compile "com.google.firebase:firebase-analytics:11.8.0" + compile "com.google.firebase:firebase-ads:11.8.0" 

The problem was only adding firebase-ads , but this was fixed.

0
source

All Articles