上線打正式包的時候遇到了/文件路徑/app/build/intermediates/shrunk_jar/ky_kaoyanRelease/minified.jar: D8: Illegal class file: Class a is missing a super type. Class file version 53這個問題,因?yàn)橹按騞ebug包一直沒有問題,剛開始遇到這個問題還是有點(diǎn)頭大,然后果斷百度,谷歌,查了一大堆資料一般給的解決方案就是Java語言版本問題,或者說gradle版本問題,還有得說是沒有開啟混淆,需要設(shè)置 minifyEnabled true,還有一部分說需要設(shè)置multiDexEnabled true,但是這些項(xiàng)目的配置中都有.
最后重新看了一下控制臺的輸出日志看到如下信息: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混淆,然后查看了一下項(xiàng)目中的配置果然為:android.enableR8=false
,沒辦法只能將這個改成true試試,然后重新打包,但是上面的警告依然存在但是錯誤變成了另改一個R8: Unknown option "-ignorewarning"
然后定位到問題把這個只是或者改成-ignorewarnings,項(xiàng)目打包成功.目前看還是對Android的打包編譯流程不夠熟悉,關(guān)于版本的更新也是要及時跟進(jìn),否則還真說不準(zhǔn)啥時候給你來個驚喜,暫時做個記錄提醒一下自己.