多个dex文件在android studio中定义了Landroid/support/

Multiple dex files define Landroid/support/v4/ in android studio(多个dex文件在android studio中定义了Landroid/support/v4/)
本文介绍了多个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 modulebuild.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'
/
本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

How to target newer versions in .gitlab-ci.yml using auto devops (java 11 instead of 8 and Android 31 instead of 29)(如何在.gitlab-ci.yml中使用自动开发工具(Java 11而不是8,Android 31而不是29)瞄准较新的版本)
Android + coreLibraryDesugaring: which Java 11 APIs can I expect to work?(Android+core LibraryDesugering:我可以期待哪些Java 11API能够工作?)
How to render something in an if statement React Native(如何在If语句中呈现某些内容Reaction Native)
How can I sync two flatList scroll position in react native(如何在本机Reaction中同步两个平面列表滚动位置)
Using Firebase Firestore in offline only mode(在仅脱机模式下使用Firebase FiRestore)
Crash on Google Play Pre-Launch Report: java.lang.NoSuchMethodError(Google Play发布前崩溃报告:java.lang.NoSuchMethodError)