1. 程式人生 > >Error:A problem was found with the configuration of task ':app:packageRelease'. > File 'F:\AndroidSt

Error:A problem was found with the configuration of task ':app:packageRelease'. > File 'F:\AndroidSt

異常資訊: 配置的屬性檔案不存在

Error:A problem was found with the configuration of task ':app:packageRelease'.File '
> F:\AndroidStudioProjects\sun\SunshineCarLife\app\build\intermediates\res\resources-release-stripped.ap_'
> specified for property 'resourceFile' does not exist.

解決方案:

buildTypes { 
debug
{ signingConfig signingConfigs.debug } release { minifyEnabled false proguardFiles getDefaultProguardFile(‘proguard- android.txt’), ‘proguard-rules.pro’ zipAlignEnabled true shrinkResources false //改為false 就解決了 signingConfig signingConfigs.release } }

特別鳴謝 網友 x158454996 的解答 出現此類問題的根源問題

出現此類問題的原因是 :

AS 2.2後minifyEnabled=true時包含了shrinkResources=true,即混淆時會自動去掉多餘資源,所以我們不需要設定shrinkResources了。

安卓開發交流群 : 595856941