Sentry-dart: Obfuscated crashes with debug files uploaded

Created on 22 Apr 2021  Â·  11Comments  Â·  Source: getsentry/sentry-dart

_Platform:_

  • [ ] Dart
  • [X] Flutter Android or iOS
  • [ ] Flutter Web

_split-debug-info and obfuscate (Flutter Android or iOS) or CanvasKit (Flutter Web):_

  • [X] Enabled
  • [ ] Disabled

_Platform installed with:_

  • [X] pub.dev
  • [ ] GitHub

Output of the command flutter doctor -v below:

➜ flutter doctor -v
[✓] Flutter (Channel keyboard_fix, 2.0.5-0.0.pre.3, on Linux, locale
    en_US.UTF-8)
    • Flutter version 2.0.5-0.0.pre.3 at /home/david/fvm/versions/master
    • Framework revision 4ac95e94c6 (3 weeks ago), 2021-04-04 10:33:36 +0200
    • Engine revision 2dce47073a
    • Dart version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /extra_drive/home/david/Android/Sdk
    • Platform android-30, build-tools 30.0.3
    • ANDROID_SDK_ROOT = /extra_drive/home/david/Android/Sdk
    • Java binary at: /usr/lib64/jvm/java-1.8.0-openjdk/bin/java
    • Java version OpenJDK Runtime Environment (IcedTea 3.18.0) (build
      1.8.0_282-b07 suse-1.4-x86_64)
    • All Android licenses accepted.

[✓] Linux toolchain - develop for Linux desktop
    • clang version 11.0.1
    • cmake version 3.19.7
    • ninja version 1.8.2
    • pkg-config version 1.7.3

[!] Android Studio (not installed)
    • Android Studio not found; download from
      https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/linux#android-setup
      for detailed instructions).

[✓] VS Code (version 1.55.2)
    • VS Code at /usr/share/code
    • Flutter extension version 3.21.0

[✓] Connected device (1 available)
    • Linux (desktop) • linux • linux-x64 • Linux

! Doctor found issues in 1 category.

The version of the SDK (See pubspec.lock):
5.0.0


I have the following issue: Android Dart stack traces are obfuscated in the dashboard but debug symbols have been uploaded.

The description goes here: The tests we did for obfuscation with Android + Sentry worked great when we tested it locally on release builds, but for some reason, the production version we released recently is giving out unsymbolicated symbols even though the debug files are correctly uploaded with sentry-cli.

I have to note that our deployment involves 2 builds for the app, an open beta and the production one. We uploaded the beta after the production, so the debug symbols did upload in that order as well. Can that confuse the dashboard because of multiple versions at the same time?

Another question I have is if there is any way to download the Dart stacktrace from the dashboard. I tried to symbolicate it myself with flutter symbolize but the raw trace in the dashboard has some null lines in there that prevent to obtain the source code location.

And last question: While testing Sentry I noticed that if an stacktrace is sent obfuscated and there are no debug symbols for that build, it will stay obfuscated in the dashboard forever, even after uploading the debug files. Events that come after, get symbolicated fine. (This was on our local release builds)

Thanks in advance!

Android flutter question

All 11 comments

@davidmartos96 thanks for reporting.

wondering if that's the case https://docs.sentry.io/platforms/flutter/troubleshooting/#known-limitations
which links to https://flutter.dev/docs/deployment/obfuscate#caveat

are we talking about only Dart stack traces, Java, or C/C++ stack traces?

Can you link me to a Sentry's issue with and without symbolication? so I can double-check the metadata.

Sentry converts stack traces to Sentry's StackTrace protocol, so I don't think you'd be able to use flutter symbolize ootb unless you convert back the way symbolize needs.

Ordering of uploading symbols does not matter, but obviously, you should have uploaded the correct symbols, that's important, wondering if you were running to a sort of caching if you just compiled one after the another.

@marandaneto You pinged someone else :sweat_smile:

@marandaneto These are all Dart traces.

Symbolicated issue: https://sentry.io/organizations/skilldevs/issues/2329914330/?project=1728432&query=is%3Aunresolved&statsPeriod=14d

Unsymbolicated issue: https://sentry.io/organizations/skilldevs/issues/2354816996/?project=1728432&query=is%3Aunresolved&statsPeriod=14d

I doubt is a caching issue, we have a flutter clean step at the very beginning

@davidmartos96 can you check those options in your project? https://docs.sentry.io/platforms/android/using-ndk/

specifically android:extractNativeLibs="true" or android.bundle.enableUncompressedNativeLibs=false, are they set?

@marandaneto You pinged someone else 😅

ups sorry

@marandaneto Thanks for the pointers!
So a difference between the builds in release mode we tested locally and the production ones is that the production builds are app bundles and we don't have the options you mention set.
I see that it is mentioned as needed in the docs when using AABs. Does that apply as well for symbolicating Dart stack traces?

@davidmartos96 yes because split-debug-info and obfuscate compile to native code anyway, please give it a try and let us know :)

@marandaneto Will do, thanks!
I guess a new release in the Play Store would be needed right? Or is there another way?

you can test an app bundle too, https://developer.android.com/guide/app-bundle/test but that's out of my scope here :)

@davidmartos96 can you check those options in your project? https://docs.sentry.io/platforms/android/using-ndk/

specifically android:extractNativeLibs="true" or android.bundle.enableUncompressedNativeLibs=false, are they set?

This ended up doing the trick. Thanks again!
Do you think it would be worth mention it in the docs related to Flutter? I have only seen it mentioned in the Android NDK docs which may be overseen by many people.
Feel free to close this!

@davidmartos96 nice.

actually, when you go to https://docs.sentry.io/platforms/flutter/upload-debug/#uploading-for-android-ndk it links to https://docs.sentry.io/platforms/android/using-ndk/ but indeed, one has to open and read it, we can make it a bit more visible.

thanks for the suggestion, will do.

Was this page helpful?
0 / 5 - 0 ratings