本文介紹了多個dex文件在android studio中定義了Landroid/support/v4/的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
我可以與許多庫集成(添加和工作)
.
但是對于 ActionBarSherlock
庫,我有很多問題.
But as for ActionBarSherlock
library, I have so many problems with it.
First Issue是熱門issue多個dex文件定義
,
我知道 duplicated android-support-v4.jar
導致它,但我現在無法解決這個問題:
I know The duplicated android-support-v4.jar
causes it, but I can not solve this issue now :
Error:Execution failed for task ':fitness:dexDebug'.
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:594)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:552)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:533)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:170)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:188)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:439)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:287)
at com.android.dx.command.dexer.Main.run(Main.java:230)
at com.android.dx.command.dexer.Main.main(Main.java:199)
at com.android.dx.command.Main.main(Main.java:103)
我遵循了 同樣的錯誤中的答案.它使用了:
I followed the answer in same error. It used :
dependencies {
compile('...') {
exclude module: 'support-v4'
}
compile 'com.android.support:support-v4:18.0.+'
}
但我收到了第二個問題:unsupported Gradle DSL method found: 'exclude()'!
錯誤.因此,我像這樣更改了 main module
的 build.gradle
:
But I received Second Issue : unsupported Gradle DSL method found: 'exclude()'!
error.
Therefore I changed build.gradle
of main module
like this:
//configurations {
// all*.exclude group: 'com.android.support', module: 'support-v4'
/
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!