_Platform:_
_IDE:_
_split-debug-info and obfuscate (Flutter Android or iOS) or CanvasKit (Flutter Web):_
_Platform installed with:_
Output of the command flutter doctor -v below:
[✓] Flutter (Channel stable, 2.0.1, on Mac OS X 10.15.7 19H524 darwin-x64, locale
zh-Hans-CN)
• Flutter version 2.0.1 at /Users/tom/opt/flutter
• Framework revision c5a4b4029c (3 周前), 2021-03-04 09:47:48 -0800
• Engine revision 40441def69
• Dart version 2.12.0
• Pub download mirror https://pub.flutter-io.cn
• Flutter download mirror https://storage.flutter-io.cn
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /Users/tom/Library/Android/sdk
• Platform android-30, build-tools 29.0.3
• ANDROID_SDK_ROOT = /Users/tom/Library/Android/sdk
• Java binary at: /Users/tom/Library/Application
Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/201.7042882/Android
Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build
1.8.0_242-release-1644-b3-6915495)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.4, Build version 12D4e
• CocoaPods version 1.10.0
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.1)
• Android Studio at /Users/tom/Library/Application
Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/201.7042882/Android
Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build
1.8.0_242-release-1644-b3-6915495)
[✓] IntelliJ IDEA Ultimate Edition (version 2020.3)
• IntelliJ at /Users/tom/Applications/JetBrains Toolbox/IntelliJ IDEA
Ultimate.app
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
[✓] VS Code (version 1.53.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.20.0
[✓] Connected device (2 available)
• iPhone 8 (mobile) • 2B6C1189-40D3-4E60-898F-2A5E58ACAA3D • ios •
com.apple.CoreSimulator.SimRuntime.iOS-14-4 (simulator)
• Chrome (web) • chrome • web-javascript •
Google Chrome 89.0.4389.90
• No issues found!
The version of the SDK (See pubspec.lock):
latest
I have the following issue:
Hi thanks for the lib! I use Flutter FFI to call some C++ code. Some crash happens there. But when looking at sentry, it does not tell me the line number in the call stack. See below:

Another example:

I wonder what should I do to reveal the line numbers? I guess I should upload some debug symbols, but there is already some method names so maybe no need for symbols? And which files should I upload (I only see instructions for C++ which is quite different)
Steps to reproduce:
Actual result:
Expected result:
@fzyzcjy thanks for reporting.
The version of the SDK (See pubspec.lock):
latest stable or null-safety version?
the other question, have you uploaded debug symbols?
@marandaneto null-safety.
the other question, have you uploaded debug symbols?
Ouch, no! Let me do it first - thank you1
@fzyzcjy you probably don't have symbols for this build anymore (unless you cached your build folder), so be sure to do it in the next release.
closing it, please comment if you find any issues and I'll glad to reopen it.
@marandaneto Hi, I wonder which files should I upload for android ndk? The doc does not mention which path to specify. I guess it is build/app or build or something like that, but I am not sure
@marandaneto
For example I have tried this:
(base) ➜ proj git:(master) sentry-cli upload-dif --org rzzsdxx --project rzzsdxx build/app/
> Found 38 debug information files
> Prepared debug information files for upload
> Uploaded 19 missing debug information files
> File upload complete:
PENDING 1b3a454f-4db6-4412-a9dd-8bd68e926b47 (intermediates/stripped_native_libs/debug/out/lib/arm64-v8a/libflutter.so; arm64 library)
PENDING 1d03f11a-6558-e460-4ede-648e129b09ad (intermediates/stripped_native_libs/debug/out/lib/x86_64/libflutter.so; x86_64 library)
PENDING 630e214e-dbdb-52db-de79-0d133f383c1a (intermediates/merged_native_libs/debug/out/lib/arm64-v8a/libsentry.so; arm64 library)
PENDING 35a4f38a-463f-04eb-a194-4282b1ad81a1 (intermediates/stripped_native_libs/release/out/lib/arm64-v8a/libvision_utils.so; arm64 library)
PENDING 86475eb7-3650-98f5-0a4c-c4d230ce5f73 (intermediates/stripped_native_libs/debug/out/lib/x86/libsentry.so; x86 library)
PENDING e2a3a0df-ecaa-c923-36db-22ed3d792764 (intermediates/stripped_native_libs/debug/out/lib/arm64-v8a/libvision_utils.so; arm64 library)
PENDING ee6213d1-f9ee-5880-773f-e025047fe291 (intermediates/stripped_native_libs/debug/out/lib/arm64-v8a/libsentry-android.so; arm64 library)
PENDING bf9f14e9-eccd-7a9c-ef86-b0bffbc85f22 (intermediates/stripped_native_libs/debug/out/lib/x86/libflutter.so; x86 library)
PENDING ba43bfcb-5221-9df7-012f-f311709f5dee (intermediates/merged_native_libs/debug/out/lib/x86/libsentry-android.so; x86 library)
PENDING 630e214e-dbdb-52db-de79-0d133f383c1a (intermediates/stripped_native_libs/debug/out/lib/arm64-v8a/libsentry.so; arm64 library)
PENDING 5366da89-5699-e332-06ff-ad37ce019fde (intermediates/merged_native_libs/debug/out/lib/x86_64/libsentry-android.so; x86_64 library)
PENDING f768647d-73d4-e2e7-c1d9-d317773d160a (intermediates/stripped_native_libs/release/out/lib/arm64-v8a/libflutter.so; arm64 library)
PENDING ee6213d1-f9ee-5880-773f-e025047fe291 (intermediates/merged_native_libs/debug/out/lib/arm64-v8a/libsentry-android.so; arm64 library)
PENDING c82209de-7d06-43d5-a52b-018a5c52b6f6 (intermediates/stripped_native_libs/debug/out/lib/x86_64/libsentry.so; x86_64 library)
PENDING ba43bfcb-5221-9df7-012f-f311709f5dee (intermediates/stripped_native_libs/debug/out/lib/x86/libsentry-android.so; x86 library)
PENDING fcebe609-0366-2bf7-8565-08207a3ba51f (intermediates/stripped_native_libs/release/out/lib/x86_64/libflutter.so; x86_64 library)
PENDING c82209de-7d06-43d5-a52b-018a5c52b6f6 (intermediates/merged_native_libs/debug/out/lib/x86_64/libsentry.so; x86_64 library)
PENDING 5366da89-5699-e332-06ff-ad37ce019fde (intermediates/stripped_native_libs/debug/out/lib/x86_64/libsentry-android.so; x86_64 library)
PENDING 86475eb7-3650-98f5-0a4c-c4d230ce5f73 (intermediates/merged_native_libs/debug/out/lib/x86/libsentry.so; x86 library)
is this correct? I guess maybe not:
debug mode maybe different from files built in release mode. For example, I may run the app in debug mode at 3pm to write code, and then at 6pm I create a release build and publish it - but the symbols in debug build is quite different from that in release build.stripped_native_libs are uploaded. but "stripped" seems to mean "no symbols"Thank you!
@fzyzcjy the path is the path you've chosen for --split-debug-info, see https://flutter.dev/docs/deployment/obfuscate#obfuscating-your-app
if you have external libs that are built out of your flutter/android project, you probably need to call sentry-cli again with the given path that contains the symbols for it.
you need to upload symbols for every build, if you wish to symbolicate every build obviously, a much better approach would be to do it only for release builds over CI or so.
@marandaneto Hi I do not enable split-debug-info...
My fastlane file:
sh("flutter", "build", "apk",
"--split-per-abi",
"--release",
"--verbose"
)
By the way, IMHO split-debug-info does not work on ios? That is why I do not enable it.
@fzyzcjy not sure if I follow, are you building an iOS or Android App? are you enabling --split-per-abi or not? does libvision is built within the flutter/ios/android tooling or outside of it?
btw your fastline file is missing the path for --split-per-abi
@marandaneto Thanks for the reply!
are you building an iOS or Android App
Both. Android fastlane:
sh("flutter", "packages", "get")
sh("flutter", "build", "apk",
"--split-per-abi",
"--release",
"--verbose"
)
...
ios fastlane:
sh("flutter", "packages", "get")
sh("flutter", "build", "ios",
"--release",
"--no-codesign"
)
...
are you enabling --split-per-abi or not
see fastlane file
does libvision is built within the flutter/ios/android tooling or outside of it?
libvision_utils is built within the tooling, if I understand flutter correctly.
indeed, I never manually call something like clang libvision_utils-related-files.cpp. I only call flutter build and so on. just like the flutter official guide.
btw your fastline file is missing the path for --split-per-abi
hmm it seems to work fine - maybe it uses the default path
@fzyzcjy
hmm it seems to work fine - maybe it uses the default path
you need to check out where those files are sitting and if all the symbols are there.
example:
flutter build apk --split-per-abi=symbols
you need to call sentry-cli with the symbols folder (for flutter symbols) and with the build folder, for your App's symbols.
@marandaneto Oops it fails:
flutter build apk --split-per-abi=symbols
Flag option "split-per-abi" should not be given a value.
Run 'flutter -h' (or 'flutter <command> -h') for available flutter commands and
options.
It is --split-debug-info
@kuhnroyal I do not use that flag
I can see that from your error, you have that error because you use the wrong flag. You need to use
flutter build apk --split-debug-info=symbols
ups sorry I've mistaken the flags, indeed, it's about split-debug-info but if you're not using it, it's correct.
if you are not using split-debug-info, you don't have to use that path, but instead the build folder.
most of the useful symbols for Android will be under intermediates/merged_native_libs but just set build as it uploads everything it finds
all you need is sentry-cli upload-dif --org $SENTRY_ORG --project $SENTRY_PROJECT build
@marandaneto @kuhnroyal Thanks for the reply! However, looking at the upload command I executed, the build/intermediates/merged_native_libs seems to only have debug-xxx files, no release-xxx files. Thus IMHO no files for the release will be uploaded?
@fzyzcjy you need to compile a release build, see:
~/Github/sentry-dart/flutter/example main *4 !2 ❯ sentry-cli upload-dif --org sentry-sdks --project sentry-flutter build 43s
Found 30 debug information files
Prepared debug information files for upload
Uploaded 7 missing debug information files
File upload complete:PENDING 29a910e7-4386-e4d3-04a8-c2da50bd2f04 (app/intermediates/merged_native_libs/release/out/lib/armeabi-v7a/libnative-sample.so; arm library)
PENDING 331033ef-8d56-1918-fef6-ec9200a950bb (app/intermediates/stripped_native_libs/release/out/lib/x86_64/libnative-sample.so; x86_64 library)
PENDING fcebe609-0366-2bf7-8565-08207a3ba51f (app/intermediates/stripped_native_libs/release/out/lib/x86_64/libflutter.so; x86_64 library)
PENDING 9eba312a-0b0c-8b01-8c42-7791100b9ee6 (app/intermediates/merged_native_libs/release/out/lib/arm64-v8a/libnative-sample.so; arm64 library)
PENDING 9eba312a-0b0c-8b01-8c42-7791100b9ee6 (app/intermediates/stripped_native_libs/release/out/lib/arm64-v8a/libnative-sample.so; arm64 library)
PENDING 331033ef-8d56-1918-fef6-ec9200a950bb (app/intermediates/merged_native_libs/release/out/lib/x86_64/libnative-sample.so; x86_64 library)
PENDING f768647d-73d4-e2e7-c1d9-d317773d160a (app/intermediates/stripped_native_libs/release/out/lib/arm64-v8a/libflutter.so; arm64 library)
btw sentry-cli hashes the files so if you already sent them, it won't send again, maybe that's what you're experiencing?
btw sentry-cli hashes the files so if you already sent them, it won't send again, maybe that's what you're experiencing? just try to cause a Crash and see if that works
@marandaneto thanks I will try in the next release.
p.s.
you need to compile a release build,
yes i compiled both debug and release