Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to merge dex Ionic 3

Last time I build successfully but after adding the number of pages I am unable to build, I did search for that error a lot but nothing works for me.For example, added and removed the platform, ionic cordova clean , ionic cordova build etc…

Following Error facing by running-- ionic cordova build android

What went wrong: Execution failed for task ‘:app:transformDexArchiveWithExternalLibsDexMergerForD ebug’. java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.de xing.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 7s

IOnic Info:

cli packages: (C:\Users\ITSERV\AppData\Roaming\npm\node_modules)

@ionic/cli-utils : 1.19.2 ionic (Ionic CLI) : 3.20.0 global packages:

cordova (Cordova CLI) : 8.0.0 local packages:

@ionic/app-scripts : 3.1.8 Cordova Platforms : android 7.0.0 Ionic Framework : ionic-angular 3.9.2 System:

Node : v6.11.2 npm : 3.10.10 OS : Windows 7

Thanks in advance!

like image 990
Umar Rasheed Avatar asked Mar 22 '18 14:03

Umar Rasheed


4 Answers

I solved this issue by running simply this command and then build the project. don't go into complicated answers like upgrading Gradle or google packages etc..

 cordova clean android 
 ionic cordova build android 
like image 127
Umar Rasheed Avatar answered Sep 20 '22 19:09

Umar Rasheed


What helped me was running:

cordova clean
like image 41
Hiep Tran Avatar answered Sep 19 '22 19:09

Hiep Tran


I solve with

Cordova Clean Android
Cordova Build Android
like image 42
Zin Min Avatar answered Sep 17 '22 19:09

Zin Min


I did struggle with this issue for 2 days after i used google maps plugin inside my app and i suppose it is because of google-play-service conflicts and i resolved it by install the latest grade release by using this command. Hope it helps anyone else facing this issue

ionic cordova plugin add cordova-android-play-services-gradle-release
like image 42
Mahesh Jadhav Avatar answered Sep 21 '22 19:09

Mahesh Jadhav