【发布时间】:2014-06-16 07:57:50
【问题描述】:
相当肯定 gradle 不适合我。几天前开始了一个运行良好的项目。更新了 android studio 并再次打开了项目。我已经尝试了我能想到的一切,从删除/更新库检查 xml 文件和结构。删除 gradle 缓存并安装最新的 jdk,这里似乎没有任何帮助。
也尝试添加:
configurations {
all*.exclude group: 'com.android.support', module: 'support-v4'
}
在stackoverflow上的其他帖子中提到
我从控制台导出了错误,它看起来像这样:
objc[2338]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: method ID not in [0, 0xffff]: 65536
at com.android.dx.merge.DexMerger$6.updateIndex(DexMerger.java:501)
at com.android.dx.merge.DexMerger$IdMerger.mergeSorted(DexMerger.java:276)
at com.android.dx.merge.DexMerger.mergeMethodIds(DexMerger.java:490)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:167)
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)
:Derp:dexDerpDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':Derp:dexDerpDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
/Applications/Android Studio.app/sdk/build-tools/19.1.0/dx --dex --num-threads=4
--output /Users/MorePathStuffForALongWhile
Error Code:
2
Output:
objc[2338]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
【问题讨论】:
-
我不认为 Hiam 所描述的问题被您提供的 Scott Barta 链接所捕获。
-
你迁移到 Dagger 1.2.2 了吗?我得到的只是将我的 Dagger 依赖项从 1.1.x 更改为 1.2.2。虽然看起来可能是基于其他搜索结果的“Android 应用程序中的方法太多”。
-
作为回应,我很确定这是“方法太多”错误:)
标签: android android-studio android-gradle-plugin build.gradle