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就行了。

发布了17 篇原创文章 · 获赞 37 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/sinat_32961877/article/details/80163347