android - Error: Multiple dex files define Landroid/support/annotations/AnimRes with Admob and Facebook Cordova plugins -


i'm building app using cordova , ionic framework.

however when build project i'm met error:

unexpected top-level exception: com.android.dex.dexexception: multiple dex files define landroid/support/annotations/animres; 

other solutions mention multiple android-support-v4.jar files conflicting, android-support-v4.jar file can find within facebook plugin.

another solution mentioned conflicting versions (i.e android-support-v4.jar conflicting android-support-v13.jar) - again, cannot see references android-support-v13.jar within project.

another solution conflicting android-support-annotations.jar , android-support-v4.jar: multiple dex files define landroid/support/annotation/animres . cannot find android-support-annotations.jar files within project, except created in: myproject\platforms\android\build\intermediates\pre-dexed\debug enter image description here

however don't understand how getting created.

how can solve problem? problem can 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 , app_name id , name of facebook application)

you need exclude android-support-v4.jar got included wizcorp facebook plugin. trick simple need create build-extras.gradle inside platforms/android , add following:

configurations { all*.exclude group: 'com.android.support', module: 'support-v4' }

and that's it, every plugin uses android support lib work fb plugin. put somewhere in default build.gradle couldn't figure out where, build-extras file auto included fine.


Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

c# - two queries in same method -