firebase-tools icon indicating copy to clipboard operation
firebase-tools copied to clipboard

Crashlytics upload of Flutter-generated symbols file works for Android but fails for iOS

Open ksilz opened this issue 4 years ago • 14 comments

[REQUIRED] Environment info

firebase-tools: 11.16.1

Platform: maOS 12.6.1 (Monteray) on M1 MacBook Pro

[REQUIRED] Test case

The test case is uploading the symbols for iOS and Android. I created these with these two Flutter commands:

  • Android: flutter build appbundle --obfuscate --split-debug-info=./etc/debug-info/build
  • iOS: flutter build ipa --export-method=ad-hoc --obfuscate --split-debug-info=./etc/debug-info/build

[REQUIRED] Steps to reproduce

  1. Unzip sym-test.zip into a directory on your PC/Mac.
  2. Go into that directory in a terminal.
  3. Execute this command to upload the Android debug symbols. Please apply your own Firebase Android app ID: firebase crashlytics:symbols:upload --app [your Android app ID] ./android.
  4. The Android debug symbols upload succeeds.
  5. Execute this command to upload the iOS debug symbols. Please apply your own Firebase Android app ID: firebase crashlytics:symbols:upload --app [your iOS app ID] ./ios.

[REQUIRED] Expected behavior

The iOS debug symbols upload succeeds.

[REQUIRED] Actual behavior

The iOS debug symbols upload fails:

% firebase --debug crashlytics:symbols:upload --app [my iOS app ID] ./ios/
[2022-12-01T22:22:08.125Z] Buildtools Jar already downloaded at /Users/karsten/.cache/firebase/crashlytics/buildtools/crashlytics-buildtools-2.9.2.jar
i  Generating symbols for ./ios/
[CRASHLYTICS LOG DEBUG] Crashlytics Buildtools initialized.
[CRASHLYTICS LOG DEBUG] Skipping dumpsyms extraction, file exists: /Users/karsten/Desktop/sym-test/.crashlytics/dump_syms.bin
[CRASHLYTICS LOG DEBUG] Breakpad symbol generator initialized: /Users/karsten/Desktop/sym-test/.crashlytics/dump_syms.bin
[CRASHLYTICS LOG DEBUG] Generating native symbol files for /Users/karsten/Desktop/sym-test/./ios; writing output to: /var/folders/cz/llwnwdqn63x4m61trzt_k9980000gn/T/crashlytics-4ffc0077-5e9d-413b-82c9-5dcc4ad35a20/nativeSymbols/1-687174595027-ios-7d0d787db5cd141a013f26/breakpad
[CRASHLYTICS LOG DEBUG] 1 native libraries found at ./ios
[CRASHLYTICS LOG DEBUG] Crashlytics generating Breakpad Symbol file for: /Users/karsten/Desktop/sym-test/./ios/app.ios-arm64.symbols
[CRASHLYTICS LOG DEBUG] Extracting Breakpad symbols to temp file: /var/folders/cz/llwnwdqn63x4m61trzt_k9980000gn/T/crashlytics-4ffc0077-5e9d-413b-82c9-5dcc4ad35a20/nativeSymbols/1-687174595027-ios-7d0d787db5cd141a013f26/breakpad/app.ios-arm64.symbols8648314908030016259.tmp
[CRASHLYTICS LOG ERROR] Crashlytics execution failed.
java.io.IOException: Breakpad symbol generation failed (exit=1), see STDERR
	at com.google.firebase.crashlytics.buildtools.ndk.internal.breakpad.BreakpadSymbolGenerator.generateSymbols(BreakpadSymbolGenerator.java:133)
	at com.google.firebase.crashlytics.buildtools.Buildtools.generateNativeSymbolFiles(Buildtools.java:273)
	at com.google.firebase.crashlytics.buildtools.CommandLineHelper.executeGenerateSymbols(CommandLineHelper.java:185)
	at com.google.firebase.crashlytics.buildtools.CommandLineHelper.executeCommand(CommandLineHelper.java:118)
	at com.google.firebase.crashlytics.buildtools.CommandLineHelper.main(CommandLineHelper.java:65)
	at com.google.firebase.crashlytics.buildtools.Buildtools.main(Buildtools.java:111)

Error: java command failed with args: -jar,/Users/karsten/.cache/firebase/crashlytics/buildtools/crashlytics-buildtools-2.9.2.jar,-symbolGenerator,breakpad,-symbolFileCacheDir,/var/folders/cz/llwnwdqn63x4m61trzt_k9980000gn/T/crashlytics-4ffc0077-5e9d-413b-82c9-5dcc4ad35a20/nativeSymbols/1-687174595027-ios-7d0d787db5cd141a013f26/breakpad,-verbose,-generateNativeSymbols,-unstrippedLibrary,./ios/,-clientName,firebase-cli;crashlytics-buildtools
%

ksilz avatar Dec 01 '22 22:12 ksilz

Same here. Works for Android, fails for iOS.

techouse avatar Dec 02 '22 17:12 techouse

Assigning to Arthur to triage further.

christhompsongoogle avatar Dec 05 '22 21:12 christhompsongoogle

Currently this is expected since this feature does not yet support iOS:

Docs

Note: Support for --split-debug-info is currently only available on Android.
For Apple platforms, support for this feature will be available in an upcoming release, but you can access it now by using the [master channel](https://docs.flutter.dev/development/tools/sdk/releases) of the Flutter SDK.

Have you tried the latest release from the Flutter SDK?

kroikie avatar Dec 06 '22 00:12 kroikie

That documentation is most likely outdated.

--split-debug-info has been working for iOS builds for quite a long while now.

And by the looks of it, Sentry supports it, so maybe this tooling just needs to be updated as well?

techouse avatar Dec 06 '22 07:12 techouse

@kroikie As @techouse pointed out, this part of the Flutter docs says that --split-debug-info is supported on iOS:

"The --split-debug-info flag specifies the directory where Flutter can output debug files. This command generates a symbol map. The apk, appbundle, ipa, ios, and ios-framework targets are currently supported."

ksilz avatar Dec 06 '22 11:12 ksilz

Still broken with Firebase tools v11.17.0 using Flutter v3.3.9

techouse avatar Dec 08 '22 12:12 techouse

Facing the same issue here, works for Android, but not for iOS

Firebase Tools v11.17.0 Flutter v3.3.9

humanolaranja avatar Dec 08 '22 16:12 humanolaranja

Same problem, works for Android, but not for iOS Firebase Tools: v11.20.0 Flutter: v3.7.0-15.0.pre.11 (Channel Master) v3.3.9 (Channel Stable)

taila-teq avatar Jan 10 '23 04:01 taila-teq

Problem persists.

Works for Android but doesn't work for iOS. Firebase Tools: v11.22.0 Flutter: v3.7.2 (stable)

techouse avatar Feb 09 '23 15:02 techouse

Thanks for reporting this all - I checked with the Flutterfire team, and they are aware of the issue and are working on a fix. Please track it here: https://github.com/firebase/flutterfire/issues/8934

Closing since this issue is coming from the flutterfire package.

joehan avatar Feb 27 '23 18:02 joehan

Is this resolved for iOS? We are still not able to upload symbol files for iOS

pushpendraKh avatar Mar 20 '25 18:03 pushpendraKh

any updates?

FetFrumos avatar Apr 02 '25 16:04 FetFrumos

We were facing a similar issue, despite having made updates, due to our use of flavors in the project.

Specifically, we overlooked adding the GoogleService-Info.plist to the Xcode resources. Additionally, we were incorrectly renaming the DefaultFirebaseOptions class in each firebase_options.dart file (e.g., DefaultFirebaseOptionsDev for firebase_options_dev.dart ) and using it, based on each flavor, in the options parameter in Firebase.initializeApp(), which seemingly affected the iOS build as well.

After perform these changes, and update the iOS build scripts, we were able to upload the symbols files.

BrendoKatagi avatar Apr 02 '25 17:04 BrendoKatagi

If you are using Windows 11, make sure to add %JAVA_HOME%\bin to your system environment variables. It worked for me!

edjostenes avatar Jun 30 '25 09:06 edjostenes