打包报错:Generate Signed APK: Errors while building APK. You can find the errors in the 'Messages' view.

Android打包遇到:Generate Signed APK: Errors while building APK. You can find the errors in the 'Messages' view.

说明在打包过程中,Gradle构建报错了,看到这个,错误原因肯定不知道是什么鬼。

打开控制台,查看build过程中报错原因,比如我遇到如下报错:

Expecting type and name instead of just '***' before '(' in line 210 of file 'C:\studioworkplace\studySample\Sample\app\build\intermediates\proguard-rules\release\aapt_rules.txt'

显然,在打包的混淆过程中遇到了问题,打开 aapt_rules.txt文件,查看210行,显然这个 fragment_zi_t.xml文件报错:

打包报错:Generate Signed APK: Errors while building APK. You can find the errors in the 'Messages' view._第1张图片

打开 fragment_zi_t.xml:

打包报错:Generate Signed APK: Errors while building APK. You can find the errors in the 'Messages' view._第2张图片

发现onclick没有指定方法名,修改好错误重新打包就OK了!

你可能感兴趣的:(打包报错:Generate Signed APK: Errors while building APK. You can find the errors in the 'Messages' view.)