Skip to content

Flutter 3.32.0 on Android, setting debugSymbolLevel to full causes the app bundle build to fail #169252

@macoshita

Description

@macoshita

Steps to reproduce

  • flutter create full_symbol_test --platforms android
  • Edit android/app/build.gradle.kts
    • buildTypes {
          release {
              // TODO: Add your own signing config for the release build.
              // Signing with the debug keys for now, so `flutter run --release` works.
              signingConfig = signingConfigs.getByName("debug")
      
              // ↓Add
              ndk {
                  debugSymbolLevel = "full"
              }
          }
      }
      
  • flutter build appbundle --release -v

Even if an error occurs, a build/app/outputs/bundle/release/app-release.aab is generated, and if you rename it to .zip and run zipinfo -1 app.zip | grep debugsymbols, you can confirm that BUNDLE-METADATA/com.android.tools.build.debugsymbols/arm64-v8a/libflutter.so.dbg is included.

❯ cp build/app/outputs/bundle/release/app-release.aab a.zip && zipinfo -1 a.zip| grep debugsymbols
BUNDLE-METADATA/com.android.tools.build.debugsymbols/arm64-v8a/libflutter.so.dbg
BUNDLE-METADATA/com.android.tools.build.debugsymbols/armeabi-v7a/libflutter.so.dbg
BUNDLE-METADATA/com.android.tools.build.debugsymbols/x86_64/libflutter.so.dbg

No problem occurs when 'symbol_table' is specified.

It seems that an error occurs if libflutter.so.sym is missing in the code below, but when 'full' is specified, libflutter.so.sym is not output and instead libflutter.so.dbg is generated.
So, it might be necessary to add a condition for .dbg here:
https://github.com/gmackall/flutter/blob/c04cd2b18ebfe30b0b6d82d0b73667eb437cd7f7/packages/flutter_tools/lib/src/android/gradle.dart#L728

Expected results

Build succeeds

Actual results

The following error is output.

[        ] libflutter.so.sym not present when checking final appbundle for debug symbols.
[        ] "flutter appbundle" took 57,364ms.
[   +2 ms] executing: sw_vers -productName
[  +10 ms] Exit code 0 from: sw_vers -productName
[        ] macOS
[        ] executing: sw_vers -productVersion
[   +9 ms] Exit code 0 from: sw_vers -productVersion
[        ] 15.4.1
[        ] executing: sw_vers -buildVersion
[   +8 ms] Exit code 0 from: sw_vers -buildVersion
[        ] 24E263
[        ] executing: uname -m
[   +4 ms] Exit code 0 from: uname -m
[        ] arm64
[  +25 ms] 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.

           Otherwise, file an issue at https://github.com/flutter/flutter/issues.

Code sample

Code sample
[Paste your code here]

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.32.0, on macOS 15.4.1 24E263 darwin-arm64, locale ja-JP)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 16.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.3)
[✓] VS Code (version 1.100.2)
[✓] Connected device (2 available)
[✓] Network resources

• No issues found!

Metadata

Metadata

Labels

P1High-priority issues at the top of the work lista: buildBuilding flutter applications with the toolc: regressionIt was better in the past than it is nowfound in release: 3.32Found to occur in 3.32found in release: 3.33Found to occur in 3.33has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer versionteam-androidOwned by Android platform teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-androidTriaged by Android platform team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions