Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease 问题处理
解决AS混淆时出现的错误:
Execution failed for task ‘:app:transformClassesAndResourcesWithProguardForRelease’
具体如下图所示:
有4个warning,提示在 Common_SurfaceView类中找不到setZOrderMediaOverlay(boolean)方法,于是查询整个项目发现并无使用过该方法,且该类中确实没有这个方法。studiio温馨提示必须处理上面的4个warning才能继续打包。
经过多次尝试如:-dontwarn class com.engin.ui.Fly_Common_SurfaceView.* { ;} 忽视该这个类的警告,发现却仍旧报错。
最后解决方案:在proguard-rules.pro混淆文件中 使用 -ignorewarnings 目的将警告忽视,最终打包成功。
问题2:
Warning:Exception while processing task java.io.IOException: proguard.ParseException: Unknown option ‘com.engin.ui.Fly_Common_SurfaceView.**’ in line 47 of file ‘F:\project\02_myproject\task05\HelpCenter\app\proguard-rules.pro’
原因:-dontwarn class com.engin.ui.Fly_Common_SurfaceView.{ *;} 在proguard-rules.pro混淆文件中添加该句话后就提示报混淆解析异常错误。上面语法错误:应该为:-dontwarn com.engin.ui.Fly_Common_SurfaceView.