奇怪:意外的顶级例外:执行失败任务的应用程序:dexDebug [英] Weird : UNEXPECTED TOP-LEVEL EXCEPTION: Execution failed for task app:dexDebug
问题描述
我并没有实现新的库,但这一问题发生在编码:
错误:未能执行任务:应用程序:dexDebug
。com.android.ide.common.internal.LoggedErrorException:无法运行命令: C:\ Android的SDK \集结工具\ 21.1.1 \ dx.bat --dex --no-优化 - 输出F:\ Android_Donbas \ ReDonbasIDEANew \程序\编译\中间体\ DEX \调试--input名单= F:\ Android_Donbas \ ReDonbasIDEANew \程序\建立\中间体\ TMP \ DEX \调试\ inputList.txt 错误code: 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.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454) 在com.android.dx.command.dexer.Main.runMonoDex(Main.java:302) 在com.android.dx.command.dexer.Main.run(Main.java:245) 在com.android.dx.command.dexer.Main.main(Main.java:214) 在com.android.dx.command.Main.main(Main.java:106)
我build.gradle:
相关性{
编译文件树(导演:库,包括:['的* .jar'])
编译com.android.support:support-v4:21.0.3
编译com.google.android.gms:播放服务:87年6月5日
编译com.google code.gson:GSON:2.3
编译com.google code.gson:GSON:2.3
编译com.google code.gson:GSON:2.2.2
编译com.google.guava:番石榴:18.0'
编译com.android.support:appcompat-v7:20.0.0
编译文件(库/ Android的异步HTTP-1.4.6.jar)
编译文件(库/ AndroidSwipeLayout-v1.1.6.jar)
编译文件(库/ Apache的mime4j-0.5.jar)
编译文件(库/ crashlytics.jar)
编译文件(库/ HttpClient的-4.2.1.jar)
编译文件(库/的HttpCore-4.2.1.jar)
编译文件(库/ httpmime-4.2.1.jar)
编译文件(库/ nineoldandroids-2.4.0.jar)
编译文件(库/ ormlite,Android的4.48.jar)
编译文件(库/ ormlite核心 - 4.48.jar)
编译文件(库/ ormlite-JDBC-4.48.jar)
编译文件(库/ osmdroid,Android的4.2.jar)
编译文件(库/ SLF4J-的Android 1.6.1-RC1.jar)
编译文件(库/通用图像装载-1.9.3.jar)
}
packagingOptions {
不包括META-INF / NOTICE.txt
不包括META-INF / LICENSE.TXT
不包括META-INF / DEPENDENCIES
不包括META-INF /注意事项
不包括META-INF /许可证
不包括META-INF / LICENSE.TXT
不包括META-INF / NOTICE.t
}
您可以hitted的65K方法限制。要使用谷歌播放服务更多的粒度,按照<一href="http://android-developers.blogspot.com.es/2014/12/google-play-services-and-dex-method.html">this指南,你只能使用你想要的部分。也许这将解决您的问题。
I didn't implement new libs but this problem occured while coding :
Error:Execution failed for task ':app:dexDebug'.
com.android.ide.common.internal.LoggedErrorException: Failed to run command: C:\android-sdk\build-tools\21.1.1\dx.bat --dex --no-optimize --output F:\Android_Donbas\ReDonbasIDEANew\app\build\intermediates\dex\debug --input-list=F:\Android_Donbas\ReDonbasIDEANew\app\build\intermediates\tmp\dex\debug\inputList.txt Error Code: 2 Output: UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536 at com.android.dx.merge.DexMerger$6.updateIndex(DexMerger.java:502) at com.android.dx.merge.DexMerger$IdMerger.mergeSorted(DexMerger.java:277) at com.android.dx.merge.DexMerger.mergeMethodIds(DexMerger.java:491) at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:168) at com.android.dx.merge.DexMerger.merge(DexMerger.java:189) at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454) at com.android.dx.command.dexer.Main.runMonoDex(Main.java:302) at com.android.dx.command.dexer.Main.run(Main.java:245) at com.android.dx.command.dexer.Main.main(Main.java:214) at com.android.dx.command.Main.main(Main.java:106)
my 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'
}
You may hitted the 65k methods limit. To use Google Play Services with more granularity, follow this guide, you can use only parts that you want. Probably this will fix your problem
这篇关于奇怪:意外的顶级例外:执行失败任务的应用程序:dexDebug的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!