Pushwoosh / pushwoosh-phonegap-plugin

Pushwoosh PhoneGap Build Plugin
Other
110 stars 139 forks source link

Multiple dex files define Lcom/google/android/gms/iid/MessengerCompat$1; #179

Closed rafaeldfdias closed 8 years ago

rafaeldfdias commented 8 years ago

There's a problem when using the pushwoosh plugin along with the cordova-plugin-mauron85-background-geolocation. When building the code the following error appears:

UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/iid/MessengerCompat$1;
    at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
    at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
    at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
    at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
    at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
    at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
    at com.android.dx.command.dexer.Main.run(Main.java:246)
    at com.android.dx.command.dexer.Main.main(Main.java:215)
    at com.android.dx.command.Main.main(Main.java:106)
DimanAM commented 8 years ago

cordova-plugin-mauron85-background-geolocation plugin uses incorrect way of referencing google play services. They include this plugin https://github.com/floatinghotpot/google-play-services which contains https://github.com/floatinghotpot/google-play-services/blob/master/libs/google-play-services_lib/libs/google-play-services.jar. Such dependencies should be referenced using gradle: https://github.com/Pushwoosh/pushwoosh-phonegap-plugin/blob/master/plugin.xml#L102

DimanAM commented 8 years ago

Oh, I accidentially picked the deprecated plugin cordova-plugin-mauron85-background-geolocation-phonegapbuild. The actual problem was the conflict between com.google.android.gms:play-services-location:9.+ and com.google.android.gms:play-services-gcm:8.4.0. This issue should be fixed in 5.1.2 release.

pugwonk commented 8 years ago

Just in case anyone else is following this, this is indeed fixed in 5.1.2, at least as far as I can see. Thanks!