Skip to content Skip to sidebar Skip to footer

Android - Duplicate Entry: Com/google/android/gms/internal/zzafz.class Error

I got this error when I run the code -> Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.> com.android.build.api.transform.TransformExcepti

Solution 1:

remove compile 'com.google.android.gms:play-services-maps:9.6.1' and clean-build the project

Solution 2:

You are including both the legacy Firebase API:

compile'com.firebase:firebase-client-android:2.3.1'

and the new Firebase APIs:

compile'com.google.firebase:firebase-database:9.2.1'compile'com.google.firebase:firebase-auth:9.2.1'

They should not be used together. Remove firebase-client-android:2.3.1 and follow the instructions in the Firebase Upgrade guide.

It is also important to use the same versions of Firebase and Play Services libraries. Don't use 9.6.1 of play-services-maps and 9.2.1 of the Firebase libs. The latest versions available are 10.0.1. Consider updating all of your dependencies to use the latest versions.

Update:

I copied the dependencies you posted and was able to reproduce the error. After I replaced the dependencies with these, the error was resolved. Do these not work for you?

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'compile'com.android.support:appcompat-v7:23.3.0'compile'com.google.android.gms:play-services-maps:10.0.1'compile'com.google.firebase:firebase-database:10.0.1'compile'com.google.firebase:firebase-auth:10.0.1'
}

Post a Comment for "Android - Duplicate Entry: Com/google/android/gms/internal/zzafz.class Error"