Reputation: 6367
I have an Ionic 2 app that worked fine. Now I made an update and when I try to build the APK I get an error.
* What went wrong:
Execution failed for task ':transformClassesWithJarMergingForRelease'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry:
com/google/android/gms/iid/zzc.class
The error tells me the problem but I don't know how to solve it. Where do I have to remove the duplicate?
This is related to the Ionic Background Geolocation plugin because if I remove that plugin the issue disappears.
Upvotes: 0
Views: 494
Reputation: 30356
The background geolocation plugin depends on the Play Services library and the error message you posted above is indicative of a mismatch in versions of the Play Services library specified in the Gradle configuration (see here for a similar error). The likely cause is that you have another plugin in your project specifying a different Play Services version. The background geolocation plugin is specifying +
, i.e. the most recent version (v11.6.0).
A possible solution is to install the cordova-android-play-services-gradle-release plugin into your project, which attempts to override the versions specified by plugins to resolve version collisions.
The background geolocation plugin also depends on the Android Support library, so after fixing the Play Services issue, you may encounter a similar problem with this. If so, you can try to use cordova-android-support-gradle-release to perform a similar override in the Gradle config.
Upvotes: 1