Hi there
I’m trying to compile my app for Android (command : ionic build android
), and I get this error :
:dexDebug
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)
Here is my package.json (I have no issue with iOS compilation btw)
{
"name": "xxxxxxx",
"version": "1.0.0",
"description": "xxxxxxxxxx",
"dependencies": {
"gulp": "^3.5.6",
"gulp-sass": "^1.3.3",
"gulp-concat": "^2.2.0",
"gulp-minify-css": "^0.3.0",
"gulp-rename": "^1.2.0"
},
"devDependencies": {
"bower": "^1.3.3",
"gulp-util": "^2.2.14",
"shelljs": "^0.3.0"
},
"cordovaPlugins": [
"cordova-plugin-statusbar",
"cordova-plugin-whitelist",
"com.ionic.keyboard",
"cordova-plugin-device",
"cordova-plugin-console",
"cordova-plugin-dialogs",
"cordova-plugin-splashscreen",
"cordova-plugin-camera",
"cordova-plugin-file",
"cordova-plugin-geolocation",
"com.danielcwilson.plugins.googleanalytics",
{
"locator": "https://github.com/phonegap-build/PushPlugin.git",
"id": "com.phonegap.plugins.PushPlugin"
},
{
"locator": "https://github.com/Wizcorp/phonegap-facebook-plugin.git",
"id": "com.phonegap.plugins.facebookconnect",
"variables": {
"APP_ID": "xxxxxxxxxx",
"APP_NAME": "xxxxxx"
}
}
],
"cordovaPlatforms": [
"ios",
"android"
]
}
If I remove the Facebook block and rebuild all :
rm -rf platforms plugins
ionic state restore
ionic build android
The build finishes without any error.
Anyone could help me?