Hey guys,
wanted to report a bug I encountered. Bug met when using xwalk for Android with other plugins (specifically in my case, Facebook plugin and Push plugin, but I can’t be sure that its only this configuration that gets the bug). To reproduce (on Windows) :
- Latest Cordova CLI 4.2.0
- Latest Ionic CLI 1.3.11
- ionic start buildtest blank
- cd buildtest
- ionic platform add android
- ionic browser add crosswalk
- ionic run android (or just build should behave the same)
- cordova -d plugin add https://github.com/phonegap/phonegap-facebook-plugin.git --variable APP_ID=“123456789” --variable APP_NAME=“myApplication”
- cordova plugin add https://github.com/phonegap-build/PushPlugin.git
- ionic run android
Here is the interesting part of the result :
:dexArmv7Debug
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Landroid/support/v4/view
/PagerAdapter;
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:45
4)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:302)
at com.android.dx.command.dexer.Main.run(Main.java:245)
at com.android.dx.command.dexer.Main.main(Main.java:214)
at com.android.dx.command.Main.main(Main.java:106)
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':dexArmv7Debug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
C:\Development\adt-bundle\sdk\build-tools\21.1.0\dx.bat --dex --no-optim
ize --output C:\Users\Jeremy\buildtest4\platforms\android\build\intermediates\de
x\armv7\debug --input-list=C:\Users\Jeremy\buildtest4\platforms\android\build\in
termediates\tmp\dex\armv7\debug\inputList.txt
Error Code:
2
Output:
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Landroid/support
/v4/view/PagerAdapter;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.ja
va: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:302)
at com.android.dx.command.dexer.Main.run(Main.java:245)
at com.android.dx.command.dexer.Main.main(Main.java:214)
at com.android.dx.command.Main.main(Main.java:106)
BUILD FAILED
Total time: 9.544 secs
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.
C:\Users\Jeremy\buildtest4\platforms\android\cordova\node_modules\q\q.js:126
throw e;
^
Error code 1 for command: cmd with args: /s /c "C:\Users\Jeremy\buildtest4\platf
orms\android\gradlew cdvBuildDebug -b C:\Users\Jeremy\buildtest4\platforms\andro
id\build.gradle -PcdvBuildArch=arm -Dorg.gradle.daemon=true"
ERROR running one or more of the platforms: Error: C:\Users\Jeremy\buildtest4\pl
atforms\android\cordova\run.bat: Command failed with exit code 8
You may not have the required environment or OS to run this project
Hope that helps !
