1. 程式人生 > >九、app\build\intermediates\res\resources-xxx-stripped.ap_' specified for property 'res

九、app\build\intermediates\res\resources-xxx-stripped.ap_' specified for property 'res

app\build\intermediates\res\resources-xxx-stripped.ap_' specified for property 'resourceFile' does not exist.

1、問題定位:出現這種情況可以分析是資原始檔的問題,定位在build.gradle中的shrinkResources

2、解決方法:首先確定自己的專案是否要混淆,minifyEnabled 是否混淆,shrinkResources 是否移除無用的resource檔案
不用混淆的話寫下面兩句,或者直接去掉這兩句

android{
    buildTypes {
        release {
            ...
minifyEnabled false shrinkResources false } } }

用混淆的話寫下面兩句

minifyEnabled true 
shrinkResources true 

如果不混淆的話,apk就會多幾M;要混淆的話就必須要上面兩個為true,還有必須在混淆檔案中寫規則,不然又有另外一些錯誤。