Wizcorp / phonegap-facebook-plugin

The official plugin for Facebook in Apache Cordova/PhoneGap
Other
1.91k stars 2.01k forks source link

Multiple dex files define Landroid/support/annotation/AnimRes (Cordova 5.0.0 / Cordova Android 4.0.0) #1090

Open mabdelfattah opened 9 years ago

mabdelfattah commented 9 years ago

I know this issue has been mentioned a lot of times, but all times people used to have Push Plugin, and I don't have it!

Here are my plugins list

com.ionic.keyboard 1.0.4 "Keyboard"
com.phonegap.plugins.barcodescanner 2.0.1 "BarcodeScanner"
com.phonegap.plugins.facebookconnect 0.11.0 "Facebook Connect"
com.pushwoosh.plugins.pushwoosh 3.5.4 "Pushwoosh"
cordova-plugin-device 1.0.1 "Device"
cordova-plugin-dialogs 1.1.1 "Notification"
cordova-plugin-geolocation 1.0.1 "Geolocation"
cordova-plugin-globalization 1.0.1 "Globalization"
cordova-plugin-google-analytics 0.8.0 "Google Universal Analytics Plugin"
cordova-plugin-inappbrowser 1.0.1 "InAppBrowser"
cordova-plugin-network-information 1.0.1 "Network Information"
cordova-plugin-splashscreen 2.1.0 "Splashscreen"
cordova-plugin-statusbar 1.0.1 "StatusBar"
cordova-plugin-whitelist 1.0.0 "Whitelist"
nl.x-services.plugins.launchmyapp 3.2.4 "Custom URL scheme"
nl.x-services.plugins.socialsharing 4.3.8 "SocialSharing"
org.pushandplay.cordova.apprate 1.1.7 "AppRate"
mabdelfattah commented 9 years ago

I just found this article http://tools.android.com/tech-docs/support-annotations which says that as of SDK 19.1, android installs annotations-support file automatically... So, I'm looking for a way to use SDK v 19 with Cordova 5 and Cordova Android 4.1.1

t1tlehto commented 9 years ago

i had this issue too. I tracked it down to an incompatibility with the cordova-plugin-google-analytics plugin. I managed to get my app to build by taking the current development branch in to use. Haven't tested it yet to see if other stuff works though.

It looks like the problem is because: The analytics plugin includes gradle command "compile "com.google.android.gms:play-services-analytics:+"" which has more recent dependency and includes com.google.android.gms:play-services-analytics:7.5.0 > com.google.android.gms:play-services-base:7.5.0 > com.android.support:support-v4:22.0.0 and so annotations are included, which clashes with the library included in the FB plugin.

mladenp commented 9 years ago

I need both Analytics and Push plugin. Whats the correct android support library i should use? I also use latest cordova cli and android.

Benzilla commented 9 years ago

Also been experiencing this problem for a while but with the admob pro plugin :/ here's a link to a question I just posted on SO which explains my problem in more detail: http://stackoverflow.com/questions/32099385/error-multiple-dex-files-define-landroid-support-annotations-animres-with-admob

ashokparmar commented 9 years ago

For me, below solution worked. http://www.thedevline.com/2014/06/unexpected-top-level-exception.html

Basically, exclude android support 4 and play service and every thing will work. I am using this plugin along with PushPlugin and Google Analytics plugin. I have tested PushPlugin and it is also working fine.

mladenp commented 9 years ago

Yeah i just fixed problem in same way, i just created build-extrass.gradle where build.gradle is located and added: configurations { all*.exclude group: 'com.android.support', module: 'support-v4' } I started writing blog post about this but didn't have time to finish it. This will fix all the problems with facebook plugin and other plugins that use android support lib.

grigored commented 9 years ago

Great, the blogpost on http://www.thedevline.com/2014/06/unexpected-top-level-exception.html solved the problem for me :+1:

arcoirislabs commented 8 years ago

Use the Telerik fork of this plugin from plugins.telerik.com/cordova repository. The issue will be solved.