sentry-dart-plugin icon indicating copy to clipboard operation
sentry-dart-plugin copied to clipboard

The stack cannot be correctly deobfuscation

Open JDongKhan opened this issue 1 year ago • 5 comments

Hello, I am a Flutter developer and I will be preparing to use Sentry to collect user crash reports. During the testing process, I found that the Flutter code was not properly deobfuscation, and I also uploaded the symbol file according to the Sentry Dart plugin document. Did I do something wrong with this?

build app

 flutter build ios --obfuscate --split-debug-info=build

upload symbol files

 flutter packages pub run sentry_dart_plugin

configure

  upload_debug_symbols: true
  upload_source_maps: true
  upload_sources: false
  project: flutter_test
  org: tc-tc
  url:  https://sentry.io
  commits: auto
  ignore_missing: true
  wait_for_processing: true
  log_level: info

I found that app.ios-arm64.symbols symbols file was not uploaded to the sentry.

image

JDongKhan avatar May 13 '24 01:05 JDongKhan

Hi which version of the plugin and flutter SDK are you using?

buenaflor avatar May 13 '24 10:05 buenaflor

The latest version

  sentry: ^8.1.0
  sentry_dart_plugin: ^2.0.0

JDongKhan avatar May 13 '24 10:05 JDongKhan

@JDongKhan thanks, can you try the plugin 1.7.1? It might be an issue with 2.0.0

buenaflor avatar May 13 '24 10:05 buenaflor

It still exists.

 flutter packages pub run sentry_dart_plugin
[❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚] 0% reading config values..        
Downloaded Sentry CLI binary checksum verification passed successfully (hash: 8693527282890285f55d9b55414905e8621dd788ad3ae4c85175b84e8eeb6a04).

retrieving config from pubspec.yaml
☑ reading config values                                                             
☑ validating config values                                                             
[❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚] 18% uploading debug symbols..                                
includeSources is disabled, not uploading sources.

INFO    2024-05-14 09:16:19.453377 +08:00 sentry-cli was invoked with the following command line: "/Users/jd/Documents/Developer/flutter_sentry/.dart_tool/pub/bin/sentry_dart_plugin/sentry-cli" "--url" "https://sentry.io" "--auth-token" "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" "--log-level" "info" "debug-files" "upload" "--org" "tc-tc" "--project" "flutter_test" "/Users/jd/Documents/Developer/flutter_sentry" "--wait"
  INFO    2024-05-14 09:16:19.453634 +08:00 Issuing a command for Organization: tc-tc Project: flutter_test

> Found 48 debug information files

> Prepared debug information files for upload

> Uploaded 21 missing debug information files

> File processing complete:

       OK 81edf08c-2467-393a-ba8d-1c0f3fb75220 (App; arm64 library)
       OK 81edf08c-2467-393a-ba8d-1c0f3fb75220 (App; arm64 debug companion)
       OK 81edf08c-2467-393a-ba8d-1c0f3fb75220 (App; arm64 library)
       OK 4c4c441b-5555-3144-a195-4ed41e4451ee (Flutter; arm64 library)
       OK bc79134a-4383-30b5-bf4e-3902b5c2617a (Runner; arm64 executable)
       OK bc79134a-4383-30b5-bf4e-3902b5c2617a (Runner; arm64 debug companion)
       OK ad0cad3b-1b51-3327-8644-8be1ff1f0ae9 (libswiftCore.dylib; arm64 library)
       OK e4b0cd52-10f6-32f3-9855-e87134f2d030 (libswiftCoreAudio.dylib; arm64 library)
       OK 25114ae1-4ae9-3dbc-b3de-7f9f9a5b45d2 (libswiftCoreFoundation.dylib; arm64 library)
       OK dc548ef9-00f9-3a15-b5db-05e39d9b5c5b (libswiftCoreGraphics.dylib; arm64 library)
       OK 62f04b7b-b664-3893-b12d-9a999cc44faf (libswiftCoreImage.dylib; arm64 library)
       OK 2989001b-87a1-36f3-80ce-9a9bc6a5e194 (libswiftCoreMedia.dylib; arm64 library)
       OK 999c2967-8a06-3cd5-82d7-d156e9440a0c (libswiftDarwin.dylib; arm64 library)
       OK 9fcba8ed-d8fd-3c16-9740-5e2a31f3e959 (libswiftDispatch.dylib; arm64 library)
       OK 9702769f-1f06-3001-ab75-5ad38e1f7d66 (libswiftFoundation.dylib; arm64 library)
       OK c466f0fe-15c1-33ee-bd5b-395407bd9982 (libswiftMetal.dylib; arm64 library)
       OK 1180ac10-0a92-39db-8497-2b6d4217b8eb (libswiftObjectiveC.dylib; arm64 library)
       OK c22bc3e2-45df-3516-95f3-31d55e664a89 (libswiftQuartzCore.dylib; arm64 library)
       OK 107c11f3-dd62-3fb4-9c8a-c74bd56c2abc (libswiftUIKit.dylib; arm64 library)
       OK 4a3b0c78-ffb3-358b-9a11-9d40c6999ffd (libswiftos.dylib; arm64 library)
       OK da93014d-0455-3eb6-8cf6-f29ebf8dc160 (package_info_plus; arm64 library)
☑ uploading debug symbols                                                             

INFO    2024-05-14 09:16:39.144015 +08:00 sentry-cli was invoked with the following command line: "/Users/jd/Documents/Developer/flutter_sentry/.dart_tool/pub/bin/sentry_dart_plugin/sentry-cli" "--url" "https://sentry.io" "--auth-token" "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" "--log-level" "info" "releases" "--org" "tc-tc" "--project" "flutter_test" "new" "[email protected]+1"

Created release [email protected]+1
[❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚] 27% uploading source maps..                               
INFO    2024-05-14 09:16:40.383401 +08:00 sentry-cli was invoked with the following command line: "/Users/jd/Documents/Developer/flutter_sentry/.dart_tool/pub/bin/sentry_dart_plugin/sentry-cli" "--url" "https://sentry.io" "--auth-token" "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" "--log-level" "info" "releases" "--org" "tc-tc" "--project" "flutter_test" "files" "[email protected]+1" "upload-sourcemaps" "/Users/jd/Documents/Developer/flutter_sentry/build/web" "--ext" "map" "--ext" "js" "--dist" "1" "--wait"

> Rewriting sources
> Adding source map references

> Nothing to upload

INFO    2024-05-14 09:16:42.182767 +08:00 sentry-cli was invoked with the following command line: "/Users/jd/Documents/Developer/flutter_sentry/.dart_tool/pub/bin/sentry_dart_plugin/sentry-cli" "--url" "https://sentry.io" "--auth-token" "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" "--log-level" "info" "releases" "--org" "tc-tc" "--project" "flutter_test" "files" "[email protected]+1" "upload-sourcemaps" "/Users/jd/Documents/Developer/flutter_sentry" "--ext" "dart" "--dist" "1" "--wait"

> Found 2 files
> Analyzing 2 sources

> Rewriting sources
> Adding source map references

> Bundled 2 files for upload
> Bundle ID: 2a731a5b-e54a-54cd-b5f1-11d87d8129b4

> Nothing to upload, all files are on the server

> File processing complete
> Organization: tc-tc
> Project: flutter_test
> Release: [email protected]+1
> Dist: 1
> Upload type: artifact bundle

Source Map Upload Report
  Scripts
    ~/lib/main.dart
    ~/test/widget_test.dart
☑ uploading source maps                                                             

Commit integration is disabled.

INFO    2024-05-14 09:16:44.117359 +08:00 sentry-cli was invoked with the following command line: "/Users/jd/Documents/Developer/flutter_sentry/.dart_tool/pub/bin/sentry_dart_plugin/sentry-cli" "--url" "https://sentry.io" "--auth-token" "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" "--log-level" "info" "releases" "--org" "tc-tc" "--project" "flutter_test" "finalize" "[email protected]+1"

Finalized release [email protected]+1

JDongKhan avatar May 14 '24 01:05 JDongKhan

image

JDongKhan avatar May 14 '24 01:05 JDongKhan

Could you share more about your set up? is this problem only on iOS ?

buenaflor avatar May 28 '24 10:05 buenaflor

None of it works. This is my example. https://github.com/JDongKhan/flutter_sentry_demo

JDongKhan avatar May 29 '24 08:05 JDongKhan

can you confirm that the debug symbols have been uploaded to sentry?

buenaflor avatar May 29 '24 08:05 buenaflor

It exists for android, but not work. image

for ios, the app.ios-arm64 file not uploaded.

JDongKhan avatar May 29 '24 09:05 JDongKhan

@JDongKhan Looking through the sample, there were several configuration issues.

  • You need to use SentryFlutter.init instead of Sentry.init
  • You need to provide sentry with the app runner
  • You don't need to call WidgetsFlutterBinding.ensureInitialized(); in your main app
  • You don't need a custom FlutterError.onError, sentry is handling this automatically for you
  • You don't need to manually set the options.release, this format is used per default
  • You don't need to provide the url param in the plugin config with sentry.io, this is the default

After fixing those I could capture a sample exception and see it with stacktrace on sentry.io:

Bildschirmfoto 2024-05-31 um 16 58 25 Bildschirmfoto 2024-05-31 um 16 47 17 Bildschirmfoto 2024-05-31 um 16 58 12

Check out the documentation on how to further config Sentry: https://docs.sentry.io/platforms/flutter/

denrase avatar May 31 '24 14:05 denrase

@denrase is it possible to do this for sentry-dart and not sentry-flutter? I cannot use sentry-flutter for app size limitations

alanalanlu avatar Aug 22 '24 19:08 alanalanlu

@alanalanlu you mean only using sentry-dart (e.g Sentry.init instead of SentryFlutter.init) in flutter applications?

buenaflor avatar Aug 23 '24 09:08 buenaflor

@alanalanlu @buenaflor How much overhead does sentry-flutter add compared to sentry-dart in your case?

denrase avatar Aug 26 '24 08:08 denrase

@denrase sentr-flutter is 2-3mb while sentry-dart is ~250kb

alanalanlu avatar Aug 27 '24 00:08 alanalanlu

@ buenaflor yes Sentry.init and not SentryFlutter.init

alanalanlu avatar Aug 27 '24 00:08 alanalanlu

@alanalanlu we have released sentry-dart/flutter8.9.0 which allows you to have stacktrace symbolication with only using Sentry.init on iOS, macOS and Android. Please try it out.

buenaflor avatar Sep 09 '24 13:09 buenaflor