在Cordova v6.1.1中添加Wizcorp / phonegap-facebook-plugin时,Android构建失败

时间:2016-04-12 11:30:11

标签: android cordova ionic-framework cordova-plugins phonegap-facebook-plugin

由于Google Play的警告,我将Cordova版本升级到最新版本(6.1.1)。之后,当我添加phonegap-facebook-plugin时,我无法创建我的项目的Android版本。它显示以下错误:

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.txt
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.

BUILD FAILED

如何解决此问题?

1 个答案:

答案 0 :(得分:0)

我修复了删除android平台并再次添加的问题:

cordova platform rm android
cordova platform add android