I am building an application using cordova and Ionic framework.
However, now when I build my project, I encounter an error:
UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException: Multiple dex files define Landroid/support/annotations/AnimRes;
Other SO solutions point to conflicts of several android-support-v4.jar , however the only android-support-v4.jar that I can find is in the facebook plugin.
Another solution mentions conflicting versions (i.e. android-support-v4.jar conflicting with android-support-v13.jar ) - again, I don't see links to android-support-v13.jar in my project.
Another solution was conflicting android-support-annotations.jar and android-support-v4.jar : several dex files defining landroid / support / annotation / AnimRes . I can not find the android-support-annotations.jar files in my project, other than what was created in: myProject\platforms\android\build\intermediates\pre-dexed\debug 
However, I do not understand how this is 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 identifier and name of the facebook application)
source share