Open roomoraaes opened 9 years ago
Yes, I am experiencing the same issue. Builds fine for iOS, but build fails for Android.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':dexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
/Users/junterreiner-x/Library/Android/sdk/build-tools/22.0.1/dx --dex --no-optimize --output /Users/junterreiner-x/Development/mobile-app/platforms/android/build/intermediates/dex/debug --input-list=/Users/junterreiner-x/Development/mobile-app/platforms/android/build/intermediates/tmp/dex/debug/inputList.txt
Error Code:
2
Output:
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Landroid/support/annotation/AnimRes;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
at com.android.dx.command.dexer.Main.run(Main.java:246)
at com.android.dx.command.dexer.Main.main(Main.java:215)
at com.android.dx.command.Main.main(Main.java:106)
I found a work around in #1090:
Add the following to the bottom of platforms/android/build.gradle
and then run cordova build android
again:
configurations { all*.exclude group: 'com.android.support', module: 'support-v4' }
Do you mean build.gradle? If so It doesn't seem to work for me. Also in the build.gradle it says at the top // GENERATED FILE! DO NOT EDIT!
Oops, had a typo. Yes build.gradle
.
If you don't want to edit build.gradle
you can put the configurations
line in a file called build-extras.gradle
right next to the existing build.gradle
file.
Ultimately I switched to this fork of the Facebook plugin which also fixed the issue:
The build gradle doesn't regenerate like it says in the file so the solution works!
http://www.thedevline.com/2014/06/unexpected-top-level-exception.html
Thanks!
@Justin-Credible : Thanks..this works for me..
I found a work around in:
Add the following to the bottom of platforms/android/build.gradle and then run cordova build android again:
configurations { all*.exclude group: 'com.android.support', module: 'support-v4' }
thank you @Justin-Credible
@Justin-Credible works for me dude, thanks.
Could you show the list of plugins you're using?
I'm having trouble getting the build phonegap . The phonegap can not run the build for android . Ios and WP is working normal. Android with this problem, someone is having the same problem ?