美文网首页
Illegal class file: Class a is m

Illegal class file: Class a is m

作者: enjoy_coding | 来源:发表于2020-08-21 09:52 被阅读0次

    上线打正式包的时候遇到了/文件路径/app/build/intermediates/shrunk_jar/ky_kaoyanRelease/minified.jar: D8: Illegal class file: Class a is missing a super type. Class file version 53这个问题,因为之前打debug包一直没有问题,刚开始遇到这个问题还是有点头大,然后果断百度,谷歌,查了一大堆资料一般给的解决方案就是Java语言版本问题,或者说gradle版本问题,还有得说是没有开启混淆,需要设置 minifyEnabled true,还有一部分说需要设置multiDexEnabled true,但是这些项目的配置中都有.

    最后重新看了一下控制台的输出日志看到如下信息:WARNING: The option 'android.enableR8' is deprecated and should not be used anymore.
    It will be removed in a future version of the Android Gradle plugin, and will no longer allow you to disable R8.
    ,看这个警告是提示开启R8混淆,然后查看了一下项目中的配置果然为:android.enableR8=false
    ,没办法只能将这个改成true试试,然后重新打包,但是上面的警告依然存在但是错误变成了另改一个R8: Unknown option "-ignorewarning"
    然后定位到问题把这个只是或者改成-ignorewarnings,项目打包成功.目前看还是对Android的打包编译流程不够熟悉,关于版本的更新也是要及时跟进,否则还真说不准啥时候给你来个惊喜,暂时做个记录提醒一下自己.

    相关文章

      网友评论

          本文标题:Illegal class file: Class a is m

          本文链接:https://www.haomeiwen.com/subject/fxayjktx.html