Reputation:
I have implemented Firebase cloud messaging into my application and i am getting the following error.
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.>com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/zzqd.class
My dependencies
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.volley:volley:1.0.0'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.facebook.android:facebook-android-sdk:4.+'
compile 'com.android.support:recyclerview-v7:23.4.0'
compile 'com.android.support:cardview-v7:23.4.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.android.support:design:23.4.0'
compile 'com.google.android.gms:play-services-auth:9.4.0'
compile 'com.google.firebase:firebase-messaging:9.4.0'
compile project(':module2')
}
apply plugin: 'com.google.gms.google-services'
If you do need Any thing else tell me i will provide that to.
Upvotes: 0
Views: 470
Reputation: 381
@Kanver Preet Checkout this link it was already answered here
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'
Upvotes: 0
Reputation: 5363
Try this
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.volley:volley:1.0.0'
compile 'com.facebook.android:facebook-android-sdk:4.+'
compile 'com.android.support:recyclerview-v7:23.4.0'
compile 'com.android.support:cardview-v7:23.4.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.android.support:design:23.4.0'
compile 'com.google.android.gms:play-services-auth:9.4.0'
compile 'com.google.firebase:firebase-messaging:9.4.0'
compile project(':module2')
}
apply plugin: 'com.google.gms.google-services'
Upvotes: 0
Reputation: 1641
Firebase can generate DuplicateFileException so you have to add the following inside your app level build.gradle as well. The following block would be added inside the android block just below the buildTypes block.
//Add the following block
packagingOptions{
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE'
}
P.S. This and Michele's answer combined worked for me.
Upvotes: 1