奇怪:意外的顶级异常:任务应用的执行失败:dexDebug

Rik*_*avi 8 android

我没有实现新的库,但编码时遇到了这个问题:

错误:任务':app:dexDebug'的执行失败.

com.android.ide.common.internal.LoggedErrorException:无法运行命令:C:\ android-sdk\build-tools\21.1.1\dx.bat --dex --no-optimize --output F:\ Android_Donbas\ReDonbasIDEANew \应用\构建\中间体\ DEX \调试--input列表= F:\ Android_Donbas\ReDonbasIDEANew \应用\建立\中间体\ TMP\DEX \调试\ inputList.txt错误代码:2输出:意外顶层例外:com.android.dex.DexIndexOverflowException:不是在方法ID [0,为0xFFFF]:65536在com.android.dx.merge.DexMerger $ 6.updateIndex(DexMerger.java:502)在com.android.dx.merge. DexMerger $ IdMerger.mergeSorted(DexMerger.java:277)在com.android.dx.merge.DexMerger.mergeMethodIds(DexMerger.java:491)在com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:168)在com.android.dx.merge.DexMerger.merge(DexMerger.java:189)处com.android.dx在com.android.dx.command.dexer.Main.runMonoDex(Main.java:302 com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)) com.android.dx.command.Main.main(Main的.java:106)

我的build.gradle:

 dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:support-v4:21.0.3'
    compile 'com.google.android.gms:play-services:6.5.87'
    compile 'com.google.code.gson:gson:2.3'
    compile 'com.google.code.gson:gson:2.3'
    compile 'com.google.code.gson:gson:2.2.2'
    compile 'com.google.guava:guava:18.0'
    compile 'com.android.support:appcompat-v7:20.0.0'
    compile files('libs/android-async-http-1.4.6.jar')
    compile files('libs/AndroidSwipeLayout-v1.1.6.jar')
    compile files('libs/apache-mime4j-0.5.jar')
    compile files('libs/crashlytics.jar')
    compile files('libs/httpclient-4.2.1.jar')
    compile files('libs/httpcore-4.2.1.jar')
    compile files('libs/httpmime-4.2.1.jar')
    compile files('libs/nineoldandroids-2.4.0.jar')
    compile files('libs/ormlite-android-4.48.jar')
    compile files('libs/ormlite-core-4.48.jar')
    compile files('libs/ormlite-jdbc-4.48.jar')
    compile files('libs/osmdroid-android-4.2.jar')
    compile files('libs/slf4j-android-1.6.1-RC1.jar')
    compile files('libs/universal-image-loader-1.9.3.jar')
}



packagingOptions {
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.t'
    }
Run Code Online (Sandbox Code Playgroud)

web*_*o80 9

你可能达到了65k方法的限制.要更精细地使用Google Play服务,请按照本指南操作,您只能使用所需的部分.这可能会解决您的问题.