Wizcorp / phonegap-facebook-plugin

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

Android build failed in cordova 6.1.1 #1262

Open forkourse opened 8 years ago

forkourse commented 8 years ago

Hi,

I upgrade my cordova version to latest (6.1.1) due to warning from Google Play. After that when i add this plugin i can't build my project. It shows following error

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':dexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
        D:\Android\sdk\build-tools\23.0.2\dx.bat --dex --no-optimize --output D:\Cocco'sCafe 2\platforms\android\build\intermediates\dex\debug --input-list=D:\Cocco'sCafe 2\platforms\android\build\intermediates\tmp\dex\debug\inputList.tx
Error Code:
        2
Output:

        UNEXPECTED TOP-LEVEL EXCEPTION:
        com.android.dex.DexException: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;
                at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:579)
                at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:535)
                at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:517)
                at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:164)
                at com.android.dx.merge.DexMerger.merge(DexMerger.java:188)
                at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:504)
                at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)
                at com.android.dx.command.dexer.Main.run(Main.java:277)
                at com.android.dx.command.dexer.Main.main(Main.java:245)
                at com.android.dx.command.Main.main(Main.java:106)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

How to fix this ?

caroso1222 commented 8 years ago

Same issue here. Any workaround for this?

caroso1222 commented 8 years ago

Found this thread... https://forum.ionicframework.com/t/ionic-crosswalk-and-facebook-plugin-not-working-together/42508/5

My problem was due to an incompatibility with a crosswalk plugin I had installed. Seems like android-support-v4.jar from cordova-facebook-plugin was clashing with android-support-v13.jar from cordova-plugin-crosswalk-webview. So the workaround is to install an older version of cordova-plugin-crosswalk-webview as such:

cordova plugin remove cordova-plugin-crosswalk-webview cordova plugin add cordova-plugin-crosswalk-webview@1.2.0