Android Studio签署的APK':app:transformClassesAndResourcesWithProguardForRelease' [英] Android Studio Signed APK ':app:transformClassesAndResourcesWithProguardForRelease'
问题描述
当我尝试在Android Studio中生成签名时,出现以下错误:
When I try to generate signed in Android Studio, I've got the following error :
错误:任务':app:transformClassesAndResourcesWithProguardForRelease'的执行失败. java.io.IOException:请首先更正以上警告.
Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'. java.io.IOException: Please correct the above warnings first.
已经进行了一些研究并找到了例如:
Already make some research and find that for example :
错误:任务':android:transformClassesAndResourcesWithProguardForRelease'执行失败
我听从了建议,但是没有用.因此,我尝试将我的buildToolsVersion
更新为23.0.2
.
I followed the advice, it didn't works. So, I tried to update my buildToolsVersion
to 23.0.2
.
也不行.
仅当我将minifyEnabled
修改为false且我不想这样做时,它才有效.
It's works only when I modify minifyEnabled
to false, and I don't want to.
能给我一个曲目吗?
推荐答案
尝试执行干净的构建(构建">干净的项目"),然后再次构建.
Try performing a clean build (Build > Clean Project) and buliding again.
如果这不起作用,则可能是Proguard正在删除应用程序中的一些重要类和/或库.查看日志中错误消息上方生成的警告.您需要将规则添加到proguard-rules.pro文件中,以保留必要的类. 此处是保留Butterknife库所需规则的示例.
If that doesn't work, it's likely Proguard is removing some important classes and/or libraries in your app. Take a look at the warnings generated above the error message in the log. You'll need to add rules to your proguard-rules.pro file to keep the necessary classes. Here is an example of the rules required to keep the Butterknife library.
这篇关于Android Studio签署的APK':app:transformClassesAndResourcesWithProguardForRelease'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!