Unable to build


#1

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 10s
40 actionable tasks: 29 executed, 11 up-to-date
Error: /Users/pratik-mac/Desktop/development/ionic/loadlink/platforms/android/gradlew: Command failed with exit code 1 Error output:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

FAILURE: Build failed with an exception.

What went wrong:
Execution failed for task ‘: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

BUILD FAILED in 10s

[ERROR] An error occurred while running cordova build android (exit code 1).


#2

Can we see some ionic info details?
Make sure to use latest Cordova version along with compatible local Android platform package.

If I get mentioned error, after checking everything is good, I remove Android platform and plugin folder and then re-add Android platform back. It could be due to miss-matches in installed plugins.


#3

try to clean build your project by gradlew clean.


#4

Try the following steps -

Add cordova-android-support-gradle-release plugin with ionic cordova plugin add cordova-android-support-gradle-release
remove android platform with ionic cordova platform rm android
then build again