天天看点

Lint found fatal errors while assembling a release target

我们经常在打包项目的时候会提示如下错误:

Lint found fatal errors while assembling a release target.
           

as自己给出的解决建议如下: 

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

上面大概的意思就是让我们在app moudle下的build.gradle文件中添加如上内容,这样在编译的时候不进行lint错误的检查,虽然这样能够解决问题,但是内心有些不安,查找资料后得知,打开app/build/reports/lint-results-yourBuildName-fatal.html 文件,里边的内容有描述造成lint检测错误的具体内容,我们找到这个文件使用浏览器打开就可以看到具体的错误信息了,根据里边的错误提示我们就可以解决问题了,我的错误原因是在layout-land中存在的xml文件在layout文件夹中没有,所以知道原因后解决问题就比较简单了。

继续阅读