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.
你能给我一个曲目吗?
推荐答案
尝试执行干净构建 (Build > Clean Project) 并再次构建.
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屋!