Lint found fatal errors while assembling a release target. 问题的解决方案

旧巷老猫 提交于 2020-03-17 16:11:35

此问题发生在编译为 release 版本时,出现错误提示如下:

 

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:
...
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
    }
}
...

信他你就输了!
如果你真的去 build.gradle(app) 的 android{...} 中按照上述提示添加后,重新编译还遇到这个提示,请尝试按照以下方法解决:

 

android {
    buildTypes {
        release {
            //在这里添加:
            lintOptions {
                checkReleaseBuilds false
                abortOnError false
            }
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

搞定。
此问题多发生在老项目用新版本IDE编译时,具体原因待查。

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!