Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

Release build stops with: Lint found fatal errors while assembling a release target

ErrorLint 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.

  • Applies to Android Gradle Plugin 8.x and 9, Gradle 8 and 9, Android Studio current stable
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 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 lintRelease
  2. 2Match what you see, then jump to its fix

    1. 1The report lists an issue with severity FatalA real fatal issue is in the code or resourcesFix
    2. 2Many existing warnings and errors; the build only needs to stop on new onesOld issues block a team that cannot fix them all todayFix
    3. 3The issue is understood and tracked, but the build must shipYou need the release now and the fatal check is the only blockerFix

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 lintRelease

2Fix

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 assembleRelease

Confirmed by developer.android.com

Did this fix it?

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 lintRelease

2Fix

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 lintRelease

Confirmed by developer.android.com

Did this fix it?

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 assembleRelease

Confirmed by developer.android.com

Did this fix it?

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

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 fix

Mobile 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

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.