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

前端 未结 5 1869
抹茶落季
抹茶落季 2020-12-20 21:40

I am new in Android. i am currently working in android app and when i try to run the app this error occurs.

I have researched but cant solve this error.

er

相关标签:
5条回答
  • 2020-12-20 22:01

    If you are using Firebase, you should read my solution. In my case I developed a new app. 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 everything AFTER firebase-core or it's about the version number 11.0.4 that have to be the same on all firebase modules you are using.

    0 讨论(0)
  • 2020-12-20 22:06

    The reason behind that may be you have include two different versions for gms. Also if you have included the complete package then there is no need to include the second 'compile 'com.google.android.gms:play-services:7.5.0'' If you need only auth services from google then dont include the complete package it ll exceed 65k methods and duplicacy chances will be there. Include this

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

    and from your code remove

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

    Execute it and let me know once.

    0 讨论(0)
  • 2020-12-20 22:09

    Excluding com.google.android.gms from the offending package worked to build the project for me, but unfortunately the app would crash during initialization. The solution for me was to upgrade all firebase dependencies from 11.6.0 to 11.8.0, ie:

    - 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 presenting itself when adding firebase-ads but this fixed it.

    0 讨论(0)
  • 2020-12-20 22:10

    In my case, it's because of the

    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"
        }
    

    No more problem!

    0 讨论(0)
  • 2020-12-20 22:10

    Please be sure that you are using identical versions of com.google.gms. You can run the next command from the project root dir to find out which versions are used:

    ./gradlew :<subproject>:dependencies
    

    Usually it is something like this:

    ./gradlew :app:dependencies 
    

    After analyzing you are able to set the same versions or exclude group from some modules or expose a version

    0 讨论(0)
提交回复
热议问题