我有一个相当大的android项目。该项目仍然可以编译,但是当我尝试编译测试时出现错误:
Execution failed for task ':app:dexDebugTest'.
trouble writing output: Too many method references: 70561; max is 65536.
You may try using --multi-dex option.
好的,我找到了 multiDexEnabled 属性并添加了
multiDexEnabled true
在里面
defaultConfig
我还扩展了我的应用程序
MultiDexApplication
但这并没有改变任何东西,我仍然得到
Execution failed for task ':logic:dexDebugTest'.
trouble writing output: Too many method references: 70561; max is 65536.
You may try using --multi-dex option.
它甚至明确地向我展示了没有 --multi-dex 参数的 dx 命令
sdk/build-tools/21.1.1/dx --dex --output /build/intermediates/dex/test/debug --input-list=build/intermediates/tmp/dex/test/debug/libraryList.txt