I have been trying to build an app that was developed in Phonegap and I can't seem to get it to build for release. It seems to build fine for the simulator in Android Studio, but when I try to do a signed release it returns errors.
I have tried building in Android Studio and the Build server, so I don't think it is something unique to my desktop configuration.
The error I get in both is:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':transformClassesWithDexForRelease'.
> 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/actions/ReserveIntents;
It is exactly the same in both Studio and Web Build.
I don't have many plugins, and I have built for release on iOS and Android with all of them:
#phonegap plugin -L
cordova-plugin-console 1.0.5 "Console"
cordova-plugin-googleplayservices 19.0.3 "Google Play Services for Android"
cordova-plugin-inappbrowser 1.7.1 "InAppBrowser"
cordova-plugin-statusbar 2.1.3 "StatusBar"
cordova-plugin-whitelist 1.3.2 "Whitelist"
onesignal-cordova-plugin 2.1.2 "OneSignal Push Notifications"
I wonder if onesignal and googleplayservices aren't colliding. Try removing onesignal and see if things compile?
You were right: the two were conflicting. Once I removed the onesignal it worked, but I needed it so I removed the googleplayservices plugin and all seems to be working so far. In fact, I am having fewer problems with crashing, so I think there was other, less obvious, conflicts happening.
Thanks for your help.