Closed ThorvaldAagaard closed 6 years ago
I was having the exact same issue, got it to work by removing and re-adding the android platform:
ionic cordova platform remove android ionic cordova platform add android
After that, the build worked.
I have now done a lot more testing, and I am able to reproduce the error following the following steps
ionic start demoapp
cd demoapp
npm install
ionic cordova plugin add cordova-plugin-firebase
npm install --save @ionic-native/firebase
npm install --save angularfire2@5.0.0-rc.6 firebase@4.9.0
(need to install these versions as newer version are not compatible with ionic 3 as it uses angular6)
ionic cordova build android
(notice this builds ok)
ionic cordova plugin add cordova-plugin-mauron85-background-geolocation
ionic cordova build android
(this will give a compile error as there are conflicting versions of google-play-services)
ionic cordova plugin add cordova-android-play-services-gradle-release
(this plugin aligns the google-play-service versions)
ionic cordova build android
Now I get the DEX-error
37 actionable tasks: 1 executed, 36 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
(node:57812) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
(node:57812) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
So it looks like a conflict between the 2 plugins, but I haven't found a way to compile the solution, so any suggestions are welcome
I got thesame :-(
finally someone found a way to resolve this
closing as resolved
I have now used a full day to try to figure this out, I have installled plugins to update to correct version of play services, after trying to update by hand. I have tried many different version, tried to update gradle-files etc
I can now with all plugins (execpt cordova-plugin-firebase) build the app for android, but as soon as I add cordova-plugin-firebase to my project i get the
com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
I even gave up and tried the cordova-plugin-fcm but that also has issue with the google libraries
currently my config is
I am using play services 15.0.0
I am using the following plugins
And my guess is that it might be a conflict with google-analytics
But any tips for solving this would be appriciated.