flutterfire icon indicating copy to clipboard operation
flutterfire copied to clipboard

πŸ› [firebase_crashlytics] dSYM is not uploaded automatically

Open dirablue opened this issue 3 years ago β€’ 16 comments

Bug report

When I tested latest version of firebase_crashlytics plugin, it didn't upload dSYM automatically.

Describe the bug

These configuration is set in Build Phases by its plugin. But it seems doesn't work.

When the exception occurred, crashlytics caught it and showed it on crashlytics dashboard. But the error message of "unprocessed crashes dSYM" was displayed.

  • unprocessed crashes dSYM

CleanShot 2023-02-22 at 13 42 58

  • Build Phase on xcode
CleanShot 2023-02-22 at 13 31 32@2x

When I executed its upload script manually, it also didn't work.

the script

./ios/Pods//FirebaseCrashlytics/upload-symbols --flutter-project "./ios/firebase_app_id_file.json"

the error message is here

Running upload-symbols in Build Phase mode
error: Could not get platform name from build environment

I couldn't find any solution of "Could not get platform name from build environment" error. is there any solution for this or do I need to prepare something for using uploading dSYM?


it works when I add new script for uploading dSYM after "[firebase_crashlytics] Crashlytics Upload Suymbols" but I'm not sure if it's correct way for this plugin.

"${PODS_ROOT}/FirebaseCrashlytics/upload-symbols" -gsp "${PROJECT_DIR}/Runner/GoogleService-Info.plist" -p ios "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}"
CleanShot 2023-02-22 at 14 57 42@2x

Flutter doctor

Run flutter doctor and paste the output below:

Click To Expand

Note: I don't use Android.

flutter doctor       
Doctor summary (to see all details, run flutter doctor -v):
[!] Flutter (Channel stable, 3.7.3, on macOS 13.1 22C65 darwin-arm64, locale en-JP)
    ! Warning: `dart` on your path resolves to /opt/homebrew/Cellar/dart/2.19.2/libexec/bin/dart, which is not inside your
      current Flutter SDK checkout at /Users/gaku/fvm/versions/3.7.3. Consider adding /Users/gaku/fvm/versions/3.7.3/bin to
      the front of your path.
    ! Upstream repository ssh://[email protected]/flutter/flutter.git is not a standard remote.
      Set environment variable "FLUTTER_GIT_URL" to ssh://[email protected]/flutter/flutter.git to dismiss this error.
[βœ—] Android toolchain - develop for Android devices
    βœ— Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.

[βœ“] Xcode - develop for iOS and macOS (Xcode 14.2)
[!] Android Studio (version 2022.1)
    βœ— Unable to find bundled Java version.
[βœ“] VS Code (version 1.75.1)
[βœ“] Connected device (1 available)
[βœ“] HTTP Host Availability

Flutter dependencies

Run flutter pub deps -- --style=compact and paste the output below:

Click To Expand
flutter pub deps -- --style=compact
Dart SDK 2.19.2
Flutter SDK 3.7.3
mpfo_mobile_client 0.0.1+29

dependencies:
- bordered_text 2.0.0 [flutter]
- carousel_indicator 1.0.6 [flutter cupertino_icons]
- carousel_slider 4.2.1 [flutter]
- collection 1.17.0
- cupertino_icons 1.0.5
- dio 4.0.6 [http_parser path]
- firebase_analytics 10.1.4 [firebase_analytics_platform_interface firebase_analytics_web firebase_core firebase_core_platform_interface flutter]
- firebase_core 2.7.0 [firebase_core_platform_interface firebase_core_web flutter meta]
- firebase_crashlytics 3.0.15 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace]
- flutter 0.0.0 [characters collection js material_color_utilities meta vector_math sky_engine]
- flutter_beacon 0.5.1 [flutter]
- flutter_dotenv 5.0.2 [flutter]
- flutter_riverpod 2.2.0 [collection flutter meta riverpod state_notifier]
- freezed_annotation 2.2.0 [collection json_annotation meta]
- get_it 7.2.0 [async collection]
- http 0.13.5 [async http_parser meta path]
- intl 0.17.0 [clock path]
- logger 1.1.0
- retrofit 3.3.1 [dio meta]
- shared_preferences 2.0.17 [flutter shared_preferences_android shared_preferences_foundation shared_preferences_linux shared_preferences_platform_interface shared_preferences_web shared_preferences_windows]
- trotter 2.0.0
- uuid 3.0.7 [crypto]

dev dependencies:
- build_runner 2.3.3 [args async analyzer build build_config build_daemon build_resolvers build_runner_core code_builder collection crypto dart_style frontend_server_client glob graphs http_multi_server io js logging meta mime package_config path pool pub_semver pubspec_parse shelf shelf_web_socket stack_trace stream_transform timing watcher web_socket_channel yaml]
- flutter_lints 2.0.1 [lints]
- flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters collection js matcher material_color_utilities meta source_span stream_channel string_scanner term_glyph]
- freezed 2.3.2 [analyzer build build_config collection meta source_gen freezed_annotation json_annotation]
- json_annotation 4.8.0 [meta]
- json_serializable 6.6.1 [analyzer async build build_config collection json_annotation meta path pub_semver pubspec_parse source_gen source_helper]
- retrofit_generator 4.2.0 [analyzer build built_collection code_builder dart_style dio retrofit source_gen tuple]

transitive dependencies:
- _fe_analyzer_shared 53.0.0 [meta]
- _flutterfire_internals 1.0.16 [collection firebase_core firebase_core_platform_interface flutter meta]
- analyzer 5.5.0 [_fe_analyzer_shared collection convert crypto glob meta package_config path pub_semver source_span watcher yaml]
- args 2.4.0
- async 2.10.0 [collection meta]
- boolean_selector 2.1.1 [source_span string_scanner]
- build 2.3.1 [analyzer async convert crypto glob logging meta path]
- build_config 1.1.1 [checked_yaml json_annotation path pubspec_parse yaml]
- build_daemon 3.1.0 [built_collection built_value http_multi_server logging path pool shelf shelf_web_socket stream_transform watcher web_socket_channel]
- build_resolvers 2.2.0 [analyzer async build collection crypto graphs logging path package_config pool pub_semver stream_transform yaml]
- build_runner_core 7.2.7 [async build build_config build_resolvers collection convert crypto glob graphs json_annotation logging meta path package_config pool timing watcher yaml]
- built_collection 5.1.1
- built_value 8.4.3 [built_collection collection fixnum meta]
- characters 1.2.1
- checked_yaml 2.0.2 [json_annotation source_span yaml]
- clock 1.1.1
- code_builder 4.4.0 [built_collection built_value collection matcher meta]
- convert 3.1.1 [typed_data]
- crypto 3.0.2 [typed_data]
- dart_style 2.2.4 [analyzer args path pub_semver source_span]
- fake_async 1.3.1 [clock collection]
- ffi 2.0.1
- file 6.1.4 [meta path]
- firebase_analytics_platform_interface 3.3.21 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface]
- firebase_analytics_web 0.5.1+12 [_flutterfire_internals firebase_analytics_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins js]
- firebase_core_platform_interface 4.5.3 [collection flutter flutter_test meta plugin_platform_interface]
- firebase_core_web 2.2.1 [firebase_core_platform_interface flutter flutter_web_plugins js meta]
- firebase_crashlytics_platform_interface 3.3.15 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface]
- fixnum 1.1.0
- flutter_web_plugins 0.0.0 [flutter js characters collection material_color_utilities meta vector_math]
- frontend_server_client 3.2.0 [async path]
- glob 2.1.1 [async collection file path string_scanner]
- graphs 2.2.0 [collection]
- http_multi_server 3.2.1 [async]
- http_parser 4.0.2 [collection source_span string_scanner typed_data]
- io 1.0.4 [meta path string_scanner]
- js 0.6.5 [meta]
- lints 2.0.1
- logging 1.1.1
- matcher 0.12.13 [meta stack_trace]
- material_color_utilities 0.2.0
- meta 1.8.0
- mime 1.0.4
- package_config 2.1.0 [path]
- path 1.8.2
- path_provider_linux 2.1.8 [ffi flutter path path_provider_platform_interface xdg_directories]
- path_provider_platform_interface 2.0.5 [flutter platform plugin_platform_interface]
- path_provider_windows 2.1.3 [ffi flutter path path_provider_platform_interface win32]
- platform 3.1.0
- plugin_platform_interface 2.1.3 [meta]
- pool 1.5.1 [async stack_trace]
- process 4.2.4 [file path platform]
- pub_semver 2.1.3 [collection meta]
- pubspec_parse 1.2.1 [checked_yaml collection json_annotation pub_semver yaml]
- riverpod 2.2.0 [collection meta stack_trace state_notifier]
- shared_preferences_android 2.0.15 [flutter shared_preferences_platform_interface]
- shared_preferences_foundation 2.1.3 [flutter shared_preferences_platform_interface]
- shared_preferences_linux 2.1.3 [file flutter path path_provider_linux path_provider_platform_interface shared_preferences_platform_interface]
- shared_preferences_platform_interface 2.1.0 [flutter plugin_platform_interface]
- shared_preferences_web 2.0.4 [flutter flutter_web_plugins shared_preferences_platform_interface]
- shared_preferences_windows 2.1.3 [file flutter path path_provider_platform_interface path_provider_windows shared_preferences_platform_interface]
- shelf 1.4.0 [async collection http_parser path stack_trace stream_channel]
- shelf_web_socket 1.0.3 [shelf stream_channel web_socket_channel]
- sky_engine 0.0.99
- source_gen 1.2.7 [analyzer async build dart_style glob path source_span yaml]
- source_helper 1.3.3 [analyzer collection source_gen]
- source_span 1.9.1 [collection path term_glyph]
- stack_trace 1.11.0 [path]
- state_notifier 0.7.2+1 [meta]
- stream_channel 2.1.1 [async]
- stream_transform 2.1.0
- string_scanner 1.2.0 [source_span]
- term_glyph 1.2.1
- test_api 0.4.16 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph matcher]
- timing 1.0.1 [json_annotation]
- tuple 2.0.1
- typed_data 1.3.1 [collection]
- vector_math 2.1.4
- watcher 1.0.2 [async path]
- web_socket_channel 2.3.0 [async crypto stream_channel]
- win32 3.1.3 [ffi]
- xdg_directories 1.0.0 [meta path process]

dirablue avatar Feb 22 '23 04:02 dirablue

Thanks for the report @dirablue Can you check this document and see if it helps in your case ?

darshankawar avatar Feb 22 '23 12:02 darshankawar

I have same issue. Not uploading dSYM automatically in Local Debug mode. (my case was I Phone Simulator) It was solved at Stop running app and Rebuild, it was not my expectation.

curoyou-nsuslab avatar Feb 23 '23 00:02 curoyou-nsuslab

@darshankawar Hi, thank you for your comment.

in this document,

If this run script does not exist, you can add it manually:

There was the run script in my case. but It doesn't work. Is this not issue of this plugin?

Because when I write the run script manually, it works. The run script what generated automatically is different from the document one and what I wrote.

@curoyou-nsuslab Thank you. Yes, I understand the dSYM will be generated on the release mode. so I think the behavior of your case is correct.

in my case, even I run release mode, it didnt' work for uploading dSYM automatically. I run app with flutter run --release.

what's version of crashlytics plugin are you using?

dirablue avatar Feb 23 '23 23:02 dirablue

@dirablue Oh, I see! I do not use release mode... I'll try release mode and report this thread.

I think I need to erase the code that I send to crashlytics in debug mode. It would be nice if this content is provided in the guide. The version I am using is 3.0.15.

Thanks very much for your help. γ‚γ‚ŠγŒγ¨γ†γ”γ–γ„γΎγ™γ€‚

curoyou-nsuslab avatar Feb 24 '23 00:02 curoyou-nsuslab

@curoyou-nsuslab

Thank you for your information ! and using Japanese word :)

Your version is latest and same with me. hum ..

the dSYM will be generated on the release mode.

Sorry, words weren't enough.

It seems "dSYM will be generated on release mode" in default settings. But I think it's possible to change the behavior on xcode.

I've set "DWARF with dSYM" for debug and release. so it might be generated on both modes.

if there is "DWARF" on debug, can you change to "DWARF with dSYM"?

CleanShot 2023-02-24 at 09 58 04

references: https://github.com/flutter/flutter/issues/116493#issuecomment-1340259052

dirablue avatar Feb 24 '23 01:02 dirablue

Yes, I did already that works. But, I not found that files... 😒

image

curoyou-nsuslab avatar Feb 24 '23 01:02 curoyou-nsuslab

I see. The dSYM will be created in this folder. doesn't exist?

CleanShot 2023-02-24 at 10 18 03@2x

In my case, even if there is the dSYM, it doesn't upload if the run script is what generated by crashlytics plugin.

dirablue avatar Feb 24 '23 01:02 dirablue

So what's the current status of the issue now ?

@dirablue Can you check below issues and see if they resonate with your case ?

https://github.com/flutter/flutter/issues/101894 https://github.com/flutter/flutter/issues/116493

darshankawar avatar Feb 27 '23 13:02 darshankawar

@darshankawar Hi, The issue is not fixed on my side and @curoyou-nsuslab .

Thank you for sharing other topics. But this issue is different of these. because dSYM exists.

The problem is generated code in Build Phase by this latest plugin doesn't work. It seems "--flutter-project" option doesn't work correctly with some conditions or environments.

$PODS_ROOT/FirebaseCrashlytics/upload-symbols --flutter-project "$PROJECT_DIR/firebase_app_id_file.json"

This code works. ( not generated code by this plugin )

"${PODS_ROOT}/FirebaseCrashlytics/upload-symbols" -gsp "${PROJECT_DIR}/Runner/GoogleService-Info.plist" -p ios "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}"

dirablue avatar Feb 28 '23 03:02 dirablue

Thanks for the update. I'll keep this issue open and label for team's thoughts and expected behavior.

/cc @Lyokone

darshankawar avatar Feb 28 '23 11:02 darshankawar

@darshankawar Thank you !

dirablue avatar Feb 28 '23 14:02 dirablue

Hi @dirablue,

If you have the error on error: Could not get platform name from build environment can you build your app with --verbose argument and check if you have a build environment variable setup called PLATFORM_NAME? Your build phase upload symbol does not work because you are missing this environment variable. Also you can try manually setup your build script base on the document here, trying using the one with --ai arg instead of -gsp as that arg is more for native iOS app. Let me know if you have encounter issue after go through those processes. Thanks!

themiswang avatar Mar 06 '23 22:03 themiswang

I had the same issue, and it turned out that I was using --obfuscate with flutter build, which caused the problem.

After removing --obfuscate, the error with the FlutterFire: "flutterfire upload-crashlytics-symbols" script that was automatically added in flutterfire 0.3.0-dev.16 disappeared.

flutter build ios \
    --release \
    --no-codesign \
    --flavor dev \
    --dart-define-from-file configs/dart_define.dev.json \
-   --obfuscate \
    --split-debug-info=build/app/outputs

KoheiKanagu avatar May 21 '23 13:05 KoheiKanagu

after hours of search I found a solution use package firebase_crashlytics: ^3.3.1 in Run script add this line only "${PODS_ROOT}/FirebaseCrashlytics/run" in input files add this line only $(SRCROOT)/$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)

run the project and error should gone.

amjad07 avatar May 22 '23 21:05 amjad07

After the plugin automatically generates the script

I changed the line

${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/

for

${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${PRODUCT_NAME}

and already corrected the problem using the script generated by the plugin, making just this small change, and after making this correction the plugin will not generate again

If anyone has the same problem, try this solution and let me know if it also helped, thank you. :)

fabegalo avatar Nov 27 '23 13:11 fabegalo

I've tested this using the Firebase documentation on two different apple projects, it worked on both. Please follow the documentation carefully.

russellwheatley avatar Dec 15 '23 10:12 russellwheatley