firebase / flutterfire

🔥 A collection of Firebase plugins for Flutter apps.
https://firebase.google.com/docs/flutter/setup
BSD 3-Clause "New" or "Revised" License
8.67k stars 3.97k forks source link

[firebase_crashlytics] Symbolication of obfuscated iOS Stack-Traces still not working #12283

Closed RCVZ closed 8 months ago

RCVZ commented 8 months ago

Bug report

Describe the bug I get obfuscated Stack traces like this:

Scherm­afbeelding 2024-02-04 om 17 05 52

Steps to reproduce

Steps to reproduce the behavior:

  1. I integrated the firebase_crashlytics package and used flutterfire_cli to setup the project locally with two flavours dev and prod
  2. I run a build in codemagic, and see in firebase crashlytics dashboard that the dSYM files have been added but without a version number
  3. Firebase crashlytics dashboard still shows obfuscated Stack Traces

Expected behavior

I can see the stack trace symbolicated.


Additional context

Add any other context about the problem here.


Flutter doctor

Run flutter doctor and paste the output below:

Click To Expand ``` [✓] Flutter (Channel stable, 3.16.9, on macOS 14.2 23C64 darwin-arm64, locale nl-NL) [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 15.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2022.3) [✓] VS Code (version 1.86.0) [✓] Connected device (2 available) [✓] Network resources ```

darshankawar commented 8 months ago

@RCVZ Check this issue and underlying comments to see if it helps in your case or not.

RCVZ commented 8 months ago

@darshankawar

Yes, I have looked at those, and nothing in that helped my case.

I did take a look in the dSYM.zip at the Info.plist

The CFBundleIdentifier shows com.apple.xcode.dsym.com.adapt.app Which is wrong it should be com.adapt.app as in the GoogleService-Info.plist which shows the correct bundle identifier.

In the Info.plist in the Runner directory I use the variable PRODUCT_BUNDLE_IDENTIFIER because of the flavors.

Any ideas why it would prepend com.apple.xcode.dsym or is that normal behavior?

darshankawar commented 8 months ago

Thanks for the feedback @RCVZ I am wondering if this is occuring due to flavors you are using in the app ? Is there a way for you to check by removing flavors to confirm if the behavior still persist or not ?

nicolasteixeira3856 commented 8 months ago

I am encountering the same issues, currently utilizing flutter_flavorizr for flavor management in Flutter.

The command I use to build the app is as follows:

flutter build ipa --flavor prod -t lib/main_prod.dart --obfuscate --split-debug-info=$(Build.SourcesDirectory)/debugsymbol

Although the 'debugsymbol' folder and corresponding .symbol file are generated successfully, I am unable to upload them due to an error. The error message displayed is:

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)

Based on similar issues, such as 8934 on GitHub, this error seems to be a known problem. I have verified that my script for uploading dsym files is functioning correctly, and they have been successfully uploaded to Firebase. However, I am uncertain of how to proceed further in resolving this issue.

This how my stack trace looks on Crashlytics dashboard:

Captura de Tela 2024-02-08 às 09 46 11

On Android both the stacktrace and the symbol upload works fine with the --obfuscate --split-debug-info flags.

RCVZ commented 8 months ago

@darshankawar I can confirm that the stack traces are correctly deobfuscated without flavors.

darshankawar commented 8 months ago

@RCVZ Thanks for the update. Can you try to re-configure using latest version of flutterfire CLI ? Based on https://github.com/invertase/flutterfire_cli/pull/247, it should be able to deobfuscate irrespective with or without flavors.

RCVZ commented 8 months ago

@darshankawar I'm already using flutterfire_cli 0.3.0-dev.19

darshankawar commented 8 months ago

2. I run a build in codemagic, and see in firebase crashlytics dashboard that the dSYM files have been added but without a version number

Thanks for the update. Is the behavior only occuring while running in CI/CD ? Or if you try locally as well, do you get same behavior ?

RCVZ commented 8 months ago

@darshankawar

This is both local and CI.

darshankawar commented 8 months ago

Can you take a look at this with underlying comments and to check if it helps in your case or not ?

RCVZ commented 8 months ago

@darshankawar

My builds don't fail so how is exiting the upload script going to solve my problem?

The problem is that there is something wrong with how the uploading/creation of the dSYMs is handled. Crashlystics can not match the versions when using flavors.

I'm not the only one experiencing this issue.

https://github.com/invertase/flutterfire_cli/issues/14#issuecomment-1934062227

https://github.com/invertase/flutterfire_cli/issues/14#issuecomment-1941147875

https://github.com/invertase/flutterfire_cli/issues/249

darshankawar commented 8 months ago

Thanks for the update. Yes, I had gone through those comments from the issue which makes me think that the issue could be at the cli and not in the plugin itself, because if the cli tool supports the flavor feature, then the issue would probably get resolved. Also, the command (flutter build ipa..) would also need to support it, so technically, it doesn't seem to be a plugin issue, because as you mentioned earlier, without flavor, you are able to get the expected behavior.

So I think it would be beneficial to follow-up in the cli tool repo for this.

AhmedLSayed9 commented 8 months ago

Same issue here using flavors.

AhmedLSayed9 commented 8 months ago

@RCVZ Do you also have empty inputs for "flutterfire upload-crashlytics-symbols" script?

Screenshot 2024-02-21 at 2 25 12 PM
RCVZ commented 8 months ago

@AhmedLSayed9 Yes mine is also empty. The "flutterfire upload-crashlytics-symbols" uses his own references for the files.

RCVZ commented 8 months ago

@AhmedLSayed9 I have commented on this issue in the CLI repo. Maybe let them know that you run into the same problems.

https://github.com/invertase/flutterfire_cli/issues/249

russellwheatley commented 8 months ago

Yes, let's move this to the correct repository, please report to this issue: https://github.com/invertase/flutterfire_cli/issues/249. Thanks 👍