I'm building an app using cordova and the Ionic framework.
- I'm using the Wizcorp facebook plugin:
https://github.com/Wizcorp/phonegap-facebook-plugin . - and I recently added the google admob plugin:
https://github.com/floatinghotpot/cordova-admob-pro
However now when I build my project I'm met with the error:
UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException: Multiple dex files define Landroid/support/annotations/AnimRes;
Other SO solutions mention multiple android-support-v4.jar
files conflicting, however the only android-support-v4.jar
file I can find is within the facebook plugin.
Another solution mentioned conflicting versions (i.e android-support-v4.jar
conflicting with android-support-v13.jar
) - again, I cannot see any references to android-support-v13.jar
within my project.
Another solution was conflicting android-support-annotations.jar
and android-support-v4.jar
: multiple dex files define landroid/support/annotation/AnimRes . I cannot find any android-support-annotations.jar
files within my project, except something that is created in: myProject\platforms\android\build\intermediates\pre-dexed\debug
However I don't understand how this is getting created.
How can I solve this problem? The problem can be easily reproduced:
>ionic start myApp tabs >cd myApp >cordova plugin add https://github.com/Wizcorp/phonegap-facebook-plugin.git --variable APP_ID="123456789" --variable APP_NAME="myApplication" >cordova plugin add cordova-plugin-admobpro >ionic platform android >ionic build android
(where APP_ID and APP_NAME are the ID and name of a facebook application)