Skip to content

Release build fails: debug symbol stripping error with AGP 8.1+ #184310

@mohan-70

Description

@mohan-70

Environment

  • Flutter: (run flutter --version and paste here)
  • Android Gradle Plugin: 8.1+
  • Gradle: (check android/gradle/wrapper/gradle-wrapper.properties)
  • OS: Windows

Problem

Release build fails with two related errors:

  1. android.bundle.enableUncompressedNativeLibs option deprecated and removed in AGP 8.1
  2. Release app bundle failed to strip debug symbols from native libraries

Steps to Reproduce

  1. Run flutter build appbundle --release
  2. Build fails at bundleRelease Gradle task

Error Output

Release app bundle failed to strip debug symbols from native libraries.
Please run flutter doctor and ensure that the Android toolchain does not
report any issues.

Root Cause

  • packagingOptions block is deprecated in AGP 8.1+ (replaced by packaging)
  • NDK debug symbol stripping conflicts with Flutter's default Gradle config

Fix Applied

  • Replaced packagingOptions with packaging in build.gradle.kts
  • Removed ndk { debugSymbolLevel = "NONE" } from release buildTypes
  • Moved import statements above plugins {} block

Expected Behavior

flutter build appbundle --release completes successfully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions