PhoneGap-push-plugin and request-location-accuracy conflict

190 Views Asked by At

I am trying to use PhoneGap-Push-Plugin as well as Cordova-plugin-request-location-accuracy. But while building apk on PhoneGap build I am getting an error.

* What went wrong:
Execution failed for task ':transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/iid/zzc;

What I tried.

<plugin name="phonegap-plugin-push" source="npm" spec="1.8.4">
<plugin name="cordova-plugin-request-location-accuracy" spec="*" />

If I install any single plugin from above two.its working. But when I m trying to install both the plugins. I am getting an error.

I am not getting why conflict is happening while using those two plugins.

1

There are 1 best solutions below

7
DaveAlden On

cordova-plugin-request-location-accuracy@* currently references Play Services library v11.+ as a dependency and [email protected] references Play Services v9.8 so this is the likely cause of your build error since two different library versions are referenced.

You can use cordova-android-play-services-gradle-release to override the versions specified by these plugins in order to align them, for example:

cordova plugin add cordova-android-play-services-gradle-release --variable PLAY_SERVICES_VERSION=9.8

This will override the version specified by cordova-plugin-request-location-accuracy@* in order to align it with [email protected].