将Cordova更新为5.3.3
后,我不得不更新facebook连接插件,特别是cordova-plugin-facebook4
。问题是,经过很多问题,我设法陷入了这个错误:
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lbolts/AggregateException;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:502)
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)
我知道这是因为bolts-android
库在项目中设置了两次。我已经在编译facebook sdk语句中做了exclude module "bolts-android"
。但是,当我运行cordova compile
时,它会覆盖build.gradle
并删除我的更改(显然)。
问题是,我可以在exclude module
文件中设置plugin.xml
规则吗?这是包含facebook库的行(我猜):
<framework src="com.facebook.android:facebook-android-sdk:4.+"/>