您的位置:首页 > 移动开发 > Android开发

Android Studio混淆打包错误

2017-08-23 17:00 253 查看

Android Studio混淆打包错误

Warning:Exception while processing task java.io.FileNotFoundException: D:…\app\build\intermediates\proguard-rules\release\aapt_rules.txt (系统找不到指定的路径。)

Error:Execution failed for task ‘:app:transformClassesAndResourcesWithProguardForRelease’.> Job failed, see logs for details

有一个混淆的文件找不到了,但是这个文件是系统生成的,那怎么办,我们只需要在菜单栏选择build –> Clean Project ,然后在build –> Make Project即可,然后就能在这个路径下找到这个aapt_rules.txt文件了,再次build apk就不会报错了哦(注意:混淆的是release)

Generate Signed APK: Errors while building APK. You can find the errors in the ‘Messages’ view.

在build.gradle文件里加上这样的一句话:

lintOptions {

checkReleaseBuilds false

abortOnError false

}

然后你重新打包编译,就会出现错误提示了:然后根据错误再调试代码

com.Android.build.api.transform.TransformException: Java.util.zip.ZipException:

duplicate entry: xxxxxxxxxxxxxxx.class

* Try:

Run with –stacktrace option to get the stack trace. Run with –info or –debug

option to get more log output.

这就是说重复引用了名叫’xxxxxxxxxxxxxxx’的类,把重复引用的’xxxxxxxxxxxxxxx’依赖包删掉。注:duplicate翻译是重复条目
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息