天天看點

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檔案夾中沒有,是以知道原因後解決問題就比較簡單了。

繼續閱讀