-1

The title says it all, I am trying to integrate firebase-ads into my application, which brought so many problems with it, some of which I managed to resolve. The problem I am facing now is an error that looks like this:

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/zzqq$zza.class

This Error occurs only when Firebase is added.

I have been searching the internet for quite a while now, but everything that I found so far doesn't seem to help.

My Module:app

apply plugin: 'com.android.application'


android {
    compileSdkVersion 25
    buildToolsVersion '25.0.0'



    defaultConfig {
        applicationId "myID"
        minSdkVersion 16
        targetSdkVersion 25
        multiDexEnabled true
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.facebook.android:facebook-android-sdk:4.8.0'
    compile 'com.android.support:appcompat-v7:25.0.1'
    compile 'com.android.support:design:25.0.1'
    compile 'com.amirarcane.recent-images:recentimages:1.0.0'
    compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.4.1'
    compile 'com.android.support:cardview-v7:25.0.1'
    compile 'com.github.chrisbanes:PhotoView:1.3.0'
    compile "com.daimajia.swipelayout:library:1.2.0@aar"
    compile "com.andkulikov:transitionseverywhere:1.7.0"
    compile 'com.google.firebase:firebase-ads:9.2.1'
}

apply plugin: 'com.google.gms.google-services'

Thank you in advance!

adjuremods
  • 2,938
  • 2
  • 12
  • 17
user6704969
  • 21
  • 1
  • 5
  • Possible duplicate of [Android :app:transformClassesWithJarMergingForDebug FAILED - ZipException: duplicate entry](http://stackoverflow.com/questions/32968171/android-apptransformclasseswithjarmergingfordebug-failed-zipexception-dupli) – Shashanth Nov 20 '16 at 17:15
  • The current version of firebase-ads is 9.8.0. Try upgrading to that. Also try doing a "clean" of your project before rebuilding. – Bob Snyder Nov 20 '16 at 18:28
  • @qbix , I have already tried that, same thing. – user6704969 Nov 20 '16 at 18:58

1 Answers1

0

After 4+ hours of trying, doing almost everything up to reinstalling Android Studio, I finally managed to make it work. For all of you out there, having the same problem, I hope this solution helps you and saves you a lot of time, which I, sadly lost.

JUST DELETE: apply plugin:'com.google.gms.google-services'

Although this is not a solution, but a workaround, it's the only thing that worked for me so far. If you do choose to go by this "workaround", don't forget you have deleted it when you will run across another problem in the future.

user6704969
  • 21
  • 1
  • 5
  • 1
    The [setup instructions for AdMob](https://firebase.google.com/docs/admob/android/quick-start#verify_app-level_buildgradle_excerpt) indicate that the statement to apply the plugin is a needed item in your build.gradle. Without it, your `google-services.json` file will not be processed. I think you will experience other problems without it. – Bob Snyder Nov 20 '16 at 19:44
  • @qbix, I am aware of that, but I will take my chances, after all, now I can at least work with it. Anyway the problems might or might not come, whereas the error already came. Nonetheless, I will stick to my solutions until something better comes up. ^^ – user6704969 Nov 20 '16 at 19:49