Open sean-hill opened 9 years ago
Hi Sean,
The issue is in that FB plugin, Cordova overrides and does not use the build.gradle (which specifies the support-v4 and bolts dependencies) in /platforms/android/FacebookLib. So those jars were also manually included in the /FacebookLib/libs folder. The android-support-v4 library then gets added twice, once from /FacebookLib/libs and once from the MAT plugin's framework dependency on Google Play Services.
The solution I found was to extend the build.gradle file like it describes here under "Extending build.gradle": https://cordova.apache.org/docs/en/4.0.0/guide/platforms/android/tools.html
where someone submitted the fix: https://github.com/Wizcorp/phonegap-facebook-plugin/pull/1081 but it was only merged into the "develop" branch.
You can add the build-extras.gradle file from their pull request to /platforms/android/FacebookLib so that Cordova actually uses the dependencies instead of the libs folder's jars: https://github.com/MSOpenTech/phonegap-facebook-plugin-1/blob/89e7156aa0ed04dd8ec7ffe92f8cabe2906cac12/platforms/android/FacebookLib/build-extras.gradle
That way, the library is included in the same way from both plugins and can be de-duped. After I added this build-extras.gradle file, my build compiled.
@john-gu Thanks for your response. The build-extras.gradle
solution worked for me!
I'll keep this issue open for visibility until the Facebook plugin's master branch is updated, thanks for bringing this to our attention.
@sean-hill Please use this Facebook plugin instead: cordova-plugin-facebook4. No baked in jar.
EDIT: I am now aware that this is an old thread but this solution still stands for anyone looking for a fix.
This plugin and Cordova's Facebook Plugin here can not be built together due to conflicting android-support library files. When I try to build, I get this error:
This issue is similar to this but in the Tune's plugin directory I do not see a
android-suppport.jar
file, and I assume it must be built into theMobileAppTracker-3.11.0.jar
file.