gpt4 book ai didi

android - 多个 dex 文件定义 Landroid/support/v4/

转载 作者:太空狗 更新时间:2023-10-29 15:46:02 26 4
gpt4 key购买 nike

我无法编译项目得到以下错误编译:

错误:任务 ':myApp:dexDebug' 执行失败。

com.android.ide.common.internal.LoggedErrorException: Failed to run command: C:\Program Files (x86)\Android\android-studio\sdk\build-tools\21.0.2\dx.bat --dex --output C:\Users\Android Studio\Android Studio\myApp\build\intermediates\dex\debug --input-list=C:\Users\myApp\Downloads\Android Studio\Android Studio\myApp\build\intermediates\tmp\dex\debug\libraryList.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:596)

当然,这段代码解决了我的问题

配置{
all*.exclude 组:'com.android.support',模块:'support-v4'

但不幸的是不让我满意

dependencies {
compile fileTree(include: '*.jar', dir: 'libs')

compile 'com.android.support:support-v4:21.+'
compile project(':PullToRefreshListFragment')
compile project(':validator')
compile project(':AndroidBootstrap')

compile 'com.google.android.gms:play-services:6.+'
compile 'com.android.support:appcompat-v7:21+'

compile 'com.github.codechimp-org.apprater:library:1.0.+'
compile 'com.sothree.slidinguppanel:library:+'
compile 'me.grantland:autofittextview:0.2.+'
compile 'io.realm:realm-android:0.71.0'

compile ('com.loopj.android:android-async-http:1.4.6')
{
exclude group: 'com.google.android', module: 'support-v4'
}

compile('de.keyboardsurfer.android.widget:crouton:1.8.5@aar') {
exclude group: 'com.google.android', module: 'support-v4'
}

compile ('io.nlopez.smartlocation:library:2.+')
{
exclude(group: 'com.google.android', module: 'gms:play-services')
}
configurations {
// all*.exclude group: 'com.android.support', module: 'support-v4'

}

如何编译项目?

最佳答案

这似乎是一个常见的 ADT 到 Android studio 迁移问题。 ADT 正在 libs/目录中寻找 android-support-v4.jar 的副本,而 Android Studio 有它自己的内部副本。迁移时,jar 文件留在 libs 目录中,这会创建一个很可能是旧版本的重复 jar。我删除了 libs 目录中的 jar,问题就解决了。

关于android - 多个 dex 文件定义 Landroid/support/v4/,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26888089/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com