Release build stops with: Lint found fatal errors while assembling a release target
Lint found fatal errors while assembling a release target.Short answer
Release builds run lint for issues of severity fatal and abort when one is found. Read the report to see which issue it is, then fix the code. If you cannot fix it now, record it in a lint baseline, lower that one issue's severity, or turn checkReleaseBuilds off as a last resort.
Fix it fast
1Find out which cause you have
Run lint for the release variant. It prints the path of the report, and the report names the issue ID that is fatal.
./gradlew lintRelease2Match what you see, then jump to its fix
- 1
The report lists an issue with severity FatalA real fatal issue is in the code or resourcesFix - 2
Many existing warnings and errors; the build only needs to stop on new onesOld issues block a team that cannot fix them all todayFix - 3
The issue is understood and tracked, but the build must shipYou need the release now and the fatal check is the only blockerFix
- 1
What does the error look like?
Lint found fatal errors while assembling a release target.
Cause 1 of 3
A real fatal issue is in the code or resources
1Check
Open the HTML report that lint writes under app/build/reports and read the issue ID and the file it points at.
./gradlew lintRelease2Fix
Fix the code the report points at. If one case is a false alarm, suppress that one spot with the SuppressLint annotation (Kotlin) or tools:ignore (XML), or change the severity in lint.xml.
@SuppressLint("NewApi")
fun logNotificationChannelInfo() { /* ... */ }3Verify
Run the release build again.
./gradlew assembleReleaseConfirmed by developer.android.com
Cause 2 of 3
Old issues block a team that cannot fix them all today
1Check
See how many issues exist in the report summary.
./gradlew lintRelease2Fix
Create a lint baseline so only new issues fail the build, and commit the baseline file.
android {
lint {
baseline = file("lint-baseline.xml")
}
}3Verify
Run lint again after the file is created. It reports only new issues.
./gradlew lintReleaseConfirmed by developer.android.com
Cause 3 of 3
You need the release now and the fatal check is the only blocker
1Check
Confirm the fatal check is on. Its default is true.
grep -n "checkReleaseBuilds\|abortOnError" app/build.gradle*2Fix
Set checkReleaseBuilds to false so the release build no longer aborts on fatal issues. Treat this as a loan, not a fix, and run lint in CI instead.
android {
lint {
checkReleaseBuilds = false
}
}3Verify
The release build passes without the lint step.
./gradlew assembleReleaseConfirmed by developer.android.com
How do I stop it coming back?
- Run ./gradlew lint in CI on every pull request, so fatal issues appear before release day.
- Keep the Android Gradle plugin current, because lint rules ship with it.
- Commit the lint baseline and shrink it over time.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
Related fixes
Mobile apps
adb cannot start because something already holds its port
adb start-server failed
The adb server must bind local TCP port 5037, and every adb client talks to it there.
2 causes, each with a fixMobile apps
The phone shows as unauthorized and Android Studio will not run the app
adb devices lists the phone but Android Studio cannot deploy to it
An unauthorized phone means it has not trusted this computer's RSA key.
3 causes, each with a fixMobile apps
Android Studio cannot pair the phone over Wi-Fi
The Pair devices over Wi-Fi dialog lists no device
Wireless pairing needs the phone on Android 11 or higher and on the same Wi-Fi network as the computer, with current Platform-Tools.
4 causes, each with a fixMobile apps
adb cannot connect to its daemon or start the server
* daemon started successfully *
The adb server is a background process on your computer that listens on TCP port 5037.
2 causes, each with a fixMobile apps
adb prints 'server version doesn't match this client; killing...'
adb server version doesn't match this client; killing...
adb runs a background server, and every adb command is a client.
3 causes, each with a fixMobile apps
adb tcpip 5555 fails because no device is found
adb: more than one device/emulator
adb tcpip only works while the device is attached and listed by adb, because it tells the phone to start listening on port 5555.
4 causes, each with a fix