Unable to merge dex Ionic 3

会有一股神秘感。 提交于 2019-12-09 17:10:12

问题


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!


回答1:


What helped me was running:

cordova clean



回答2:


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



回答3:


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 



回答4:


I solve with

Cordova Clean Android
Cordova Build Android



回答5:


I have the same issue

(Unable to merge dex Ionic)

when I created the Ionic app. When I run the app the

BUILD FAILED in 11s 37 actionable tasks: 3 executed

error occurred. First I use the following solution but it doesn't work for me but it work for the other I guess.

configurations.all {
    resolutionStrategy {
       force 'com.android.support:support-v4:26.1.0'
    } 
}

Finally this is what helped me to overcome the issue of failing to build the app.

cordova clean android
ionic cordova build android
ionic cordova run android (To re-launch the app)



回答6:


I also faced this issued. I solved it via two steps:

Step 1 : cordova clean

Step 2: cordova build




回答7:


Above commands didn't fix my problem.

I change the following line in project.properties in platforms folder

com.google.android.gms:play-services-analytics:11.0.1

to

com.google.android.gms:play-services-analytics:+

and it's fixed




回答8:


Copying this answer from this Github issue comment from Trent Gardner, since anything else didn't work for me:

Fix for the Facebook plugin was to force the Facebook SDK to version 4.25.0.

cordova plugin add cordova-plugin-platform-replace

Then add to your config.xml

<platform name="android">
  <replace-string file="project.properties" find="regex:com\.facebook\.android\:facebook-android-sdk\:[\+0-9\.]+" replace="com.facebook.android:facebook-android-sdk:4.25.0" />
</platform>

Finally run cordova prepare android

Works with the latest 1.9.1 version of cordova-facebook-plugin4



来源:https://stackoverflow.com/questions/49430756/unable-to-merge-dex-ionic-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!