Android 打release包異常 Lint found fatal errors while assembling a release target.

運行debug時沒有出現問題,但是打包過程中出現異常,

 

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文件中,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
    }

但是不建議這樣做,這只是關閉了lint checkReleaseBuilds 的檢查,異常依然存在。

最根本的解決方法還是找到異常所在:

在項目的build文件夾下找到這兩個文件:

 

兩個文件都可以,不過lint-results-resease-fatal.html可以直觀的查找到異常信息:

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章