Android multidex在使用proguard时无法支持

12

我更新了所有的构建工具、support library和google Play services,但我仍然遇到了以下错误:

Error:Execution failed for task ':app:shrinkReleaseMultiDexComponents'

java.io.IOException: The output jar [app\build\intermediates\multi-dex\release\componentClasses.jar] must be specified after an input jar, or it will be empty.

我可以通过将minifyEnabled设置为false来解决这个问题,但这不是我想要的。有没有人知道如何修复它?


你找到解决方案了吗? - Fishman
1
我使用了minifyEnabled参数并将其设置为false进行发布。 - Ramesh_D
你有找到任何东西吗?请务必回复。还是卡在同一个问题上了吗? - Sudhanshu Gaur
1个回答

8

最后,我成功生成了APK并将minifyEnabled设置为true。

实际上,问题是由于一些重复的类出现了警告,但我没有注意到。

对于我来说,我在proguard-rules.pro中添加了

-dontwarn com.aphidmobile.**

同样的方法,您需要指定哪些库产生了重复的警告。

这个方法非常有效!


aphidmobile是什么?它是你正在使用的某个库吗? - Narendra Singh
你有找到任何东西吗?请务必回复。还是卡在同一个问题上了吗? - Sudhanshu Gaur

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接