Today I got an error in Android studio while generating a release APK, “Lint found fatal errors while assembling a release target”. Although App is running successfully in Debug mode. This error happens when we have some issues in some XML files or some other issue not allowing the APK to build. We have the following ways to solve this error.
How to Fix Lint found fatal errors
Android studio shows all build errors in html
& xml
file present at the following link. The best way to solve this error is, just open that file in your browser, check the error and fix it.
For that navigate to the following file & open it in the browser.
/YOUR_APPLICATION/app/build/reports/lint-results-release-fatal.html
When I opened the file in my browser I have seen the following error report. In my scenario, we can see I have an error in my XML file. In your scenario, the error can be different. Just trace your error and try to fix it.
In Android Studio, you can also use Analyze > Inspect Code menu option to manually run inspections. Inspection Results window. Here you find the official Android documentation.
Alternative Solution-
There is another way to suppress the lint warnings by adding below code into your build.gradle file as Android Studio suggested. But it’s not recommended.
android {
lintOptions {
checkReleaseBuilds false
abortOnError false
}
}