Error:A problem was found with the configuration of task ':app:packageRelease'.

1 .  Error:A problem was found with the configuration of task ':app:packageRelease'.

> File '\app\build\intermediates\res\resources-release-stripped.ap_' specified for property 'resourceFile' does not exist.資源不存在,

buildTypes {
    release {
        minifyEnabled true
        shrinkResources false   // 改爲false 就OK了
        signingConfig signingConfigs.release
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
    debug {
        minifyEnabled true
        shrinkResources false //改爲false 
          signingConfig signingConfigs.release
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }

}

解決方案:

出現的原因是:

AS 2.2後 minifyEnabled=true  時包含了shrinkResources=true,

即混淆時會自動去掉多餘資源,所以我們不需要設置shrinkResources了


2、如果在簽名時android studio報"Master password is required to unlock the password database.The password database will be unlocked during this session for all subsystems."

那麼直接點擊彈窗右下角的“Reset”按鈕,再輸入密碼和確認密碼就好了。

我這邊出現這個錯誤的原因是,兩套源碼, 同一個包名ID,想用同一個簽名打包,在新的項目上用的時候就提示密碼錯誤,然後 Reset  一下就好了。不放心,可以把 jks 備份一下,

3.

Error:Execution failed for task ‘:app:lintVitalRelease‘.

> Lint found fatal errors while assembling a release target.
To proceed, either fix the issues identified by lint, or modify your build script as follows:
...

這個studio有直接給出解決辦法:

android {
  lintOptions {
    checkReleaseBuilds false
    // Or, if you prefer, you can continue to check for errors in release builds,
    // but continue the build even when errors are found:
    abortOnError false
}
}

4.選擇版本類型時signtrue versions無法勾選,一般不會出現這種情況,我是在二次打包的時候不知道怎麼搞的,反正就是不能選中,但是這時候是可以實際“Finish”的,所以不用管它,直接點擊Finish就行了。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章