Android打包报错:Lint found fatal errors while assembling a release target. To proceed, either fix the..

最近在打包Apk时出现以下错误:

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中添加以下字段,但是不推荐

lintOptions {       
		checkReleaseBuilds false                
 		abortOnError false      
    }

注意:不要跟随便忽略任何小问题,查阅过资料,发现这是说明了工程内有着不能随便忽视的错误。所以应该着重于解决问题,而不是忽略它。

解决方法:

AS已经将错误报告保存到(工程文件路径)/build/reports/lint-results-yourBuildName-fatal.html的路径里。我们可以用浏览器中打开这个文件来看错误报告。

打开后,可以看到网页内的错误报告,然后根据报告修改工程错误的地方即可。

可以通过这个问答帖了解更多:

https://stackoverflow.com/questions/24098494/applintvitalrelease-error-when-generating-signed-apk

共勉!

猜你喜欢

转载自blog.csdn.net/Nobody_else_/article/details/109104410