cordova - Multiple dex files define Lcom/google/android/gms/iid/zzc

后端 未结 2 1199
耶瑟儿~
耶瑟儿~ 2021-02-15 03:51

I am trying to compile a cordova app for android and I am getting this error. Any ideas? This is the error I am getting:

FAILURE: Build failed with an exception.         


        
相关标签:
2条回答
  • 2021-02-15 04:24

    This issue is caused by a mismatch of versions of the Google Play Services library specified by two or more plugins.

    The solution for me was to upgrade one of my plugins - phonegap-plugin-push - to the latest version 1.10.5.

    This worked because phonegap-plugin-push@1.10.5 contains a commit which changed the pinned version from 10.2+ to 11+.

    Most likely you have another plugin in your project which specifies com.google.android.gms:*:+, which will currently also resolve to v11, because this is currently the latest release.

    Update

    Since I've been encountering this problem myself, I've just created a plugin which contains a Gradle workaround for plugins containing conflicting versions of the Play Services library: cordova-android-play-services-gradle-release. You should just be able to add it to your problematic project and it should fix the build:

    cordova plugin add cordova-android-play-services-gradle-release
    
    0 讨论(0)
  • 2021-02-15 04:27

    The solution is to upgrade phonegap-plugin-push@1.10.5 only.

    There is no need to update any other thing.

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