Crashlytics upload of Flutter-generated symbols file works for Android but fails for iOS
[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
- Unzip sym-test.zip into a directory on your PC/Mac.
- Go into that directory in a terminal.
- 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. - The Android debug symbols upload succeeds.
- 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
%
Same here. Works for Android, fails for iOS.
Assigning to Arthur to triage further.
Currently this is expected since this feature does not yet support iOS:
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?
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?
@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."
Still broken with Firebase tools v11.17.0 using Flutter v3.3.9
Facing the same issue here, works for Android, but not for iOS
Firebase Tools v11.17.0 Flutter v3.3.9
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)
Problem persists.
Works for Android but doesn't work for iOS. Firebase Tools: v11.22.0 Flutter: v3.7.2 (stable)
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.
Is this resolved for iOS? We are still not able to upload symbol files for iOS
any updates?
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.
If you are using Windows 11, make sure to add %JAVA_HOME%\bin to your system environment variables. It worked for me!