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.72k stars 3.97k forks source link

🐛 [firebase_crashlytics] Cannot find a possible way to implement firebase_crashlytics when adding flutter app to existing native app #6400

Closed ParasGarg7 closed 2 years ago

ParasGarg7 commented 3 years ago

Bug report

Couldn't find a possible way to add Firebase Crashlytics to track the crashes in the Flutter code when we add the Flutter App to existing Native code using the docs provided by Flutter

Steps to reproduce

Steps to reproduce the behavior:

  1. Follow the doc provided by Flutter to add the Flutter app to native code.
  2. Use any of there samples to do so.
  3. Make the respective changes in each Native App for adding Firebase Crashlytics.
  4. Try to add Firebase Crashlytics package to Flutter app using the doc.

Expected behavior

Since there are no ios and android folders when create a Flutter module, so there is no place to make the changes in the naticve folders inside flutter. Also the .ios and .android folders which are created will be removed any time we perform flutter clean and also they are not to be source controlled(refer the note here), any changes made to these folders will not be shared with any of the other developers or inside any CI/CD setups we may do.

So I couldn't find any way to track any crashes which will be raised inside the Flutter screens.

Sample project

Use the Sample code provided by Flutter for adding Flutter to existing apps


Flutter doctor

Run flutter doctor and paste the output below:

Click To Expand ``` Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 2.2.1, on macOS 11.2.2 20D80 darwin-x64, locale en-GB) [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) [✓] Xcode - develop for iOS and macOS [✓] Chrome - develop for the web [✓] Android Studio (version 4.1) [✓] Connected device (3 available) ```

Flutter dependencies

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

Click To Expand ``` Dart SDK 2.13.1 Flutter SDK 2.2.1 customer_app_module 1.0.0+1 dependencies: - cupertino_icons 1.0.3 - dartz 0.10.0-nullsafety.2 - dio 4.0.0 [http_parser path] - equatable 2.0.3 [collection meta] - firebase_core 1.3.0 [firebase_core_platform_interface firebase_core_web flutter meta] - firebase_crashlytics 1.0.0 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace] - flutter 0.0.0 [characters collection meta typed_data vector_math sky_engine] - get_it 7.1.3 [async collection] - intl 0.17.0 [clock path] - provider 5.0.0 [collection flutter nested] dev dependencies: - build_runner 2.0.4 [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 pedantic pool pub_semver pubspec_parse shelf shelf_web_socket stack_trace stream_transform timing watcher web_socket_channel yaml] - flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters charcode collection matcher meta source_span stream_channel string_scanner term_glyph typed_data] - http_mock_adapter 0.2.1 [dio mockito] - mockito 5.0.10 [analyzer build code_builder collection dart_style matcher meta path source_gen test_api] transitive dependencies: - _fe_analyzer_shared 22.0.0 [meta] - analyzer 1.7.1 [_fe_analyzer_shared cli_util collection convert crypto glob meta package_config path pub_semver source_span watcher yaml pedantic] - args 2.1.1 - async 2.6.1 [meta collection] - boolean_selector 2.1.0 [source_span string_scanner] - build 2.0.2 [analyzer async convert crypto glob logging meta path] - build_config 1.0.0 [checked_yaml json_annotation path pubspec_parse yaml] - build_daemon 3.0.0 [built_collection built_value http_multi_server logging pedantic path pool shelf shelf_web_socket stream_transform watcher web_socket_channel] - build_resolvers 2.0.3 [analyzer async build crypto graphs logging path package_config pool pub_semver stream_transform yaml] - build_runner_core 7.0.0 [async build build_config build_resolvers collection convert crypto glob graphs json_annotation logging meta path package_config pedantic pool timing watcher yaml] - built_collection 5.0.0 - built_value 8.0.6 [built_collection collection fixnum] - characters 1.1.0 - charcode 1.2.0 - checked_yaml 2.0.1 [json_annotation source_span yaml] - cli_util 0.3.0 [meta path] - clock 1.1.0 - code_builder 4.0.0 [built_collection built_value collection matcher meta] - collection 1.15.0 - convert 3.0.0 [typed_data] - crypto 3.0.1 [collection typed_data] - dart_style 2.0.1 [analyzer args path pub_semver source_span] - fake_async 1.2.0 [clock collection] - file 6.1.1 [meta path] - firebase_core_platform_interface 4.0.1 [collection flutter meta plugin_platform_interface] - firebase_core_web 1.1.0 [firebase_core_platform_interface flutter flutter_web_plugins js meta] - firebase_crashlytics_platform_interface 2.0.0 [collection firebase_core flutter meta plugin_platform_interface] - fixnum 1.0.0 - flutter_web_plugins 0.0.0 [flutter js characters collection meta typed_data vector_math] - frontend_server_client 2.1.0 [async path] - glob 2.0.1 [async collection file path pedantic string_scanner] - graphs 2.0.0 - http_multi_server 3.0.1 [async] - http_parser 4.0.0 [charcode collection source_span string_scanner typed_data] - io 1.0.0 [meta path string_scanner] - js 0.6.3 - json_annotation 4.0.1 - logging 1.0.1 - matcher 0.12.10 [stack_trace] - meta 1.3.0 - mime 1.0.0 - nested 1.0.0 [flutter] - package_config 2.0.0 [path] - path 1.8.0 - pedantic 1.11.0 - plugin_platform_interface 2.0.0 [meta] - pool 1.5.0 [async stack_trace] - pub_semver 2.0.0 [collection] - pubspec_parse 1.0.0 [checked_yaml collection json_annotation pub_semver yaml] - shelf 1.1.4 [async collection http_parser path stack_trace stream_channel] - shelf_web_socket 1.0.1 [shelf stream_channel web_socket_channel] - sky_engine 0.0.99 - source_gen 1.0.1 [analyzer async build dart_style glob meta path pedantic source_span] - source_span 1.8.1 [collection path term_glyph] - stack_trace 1.10.0 [path] - stream_channel 2.1.0 [async] - stream_transform 2.0.0 - string_scanner 1.1.0 [charcode source_span] - term_glyph 1.2.0 - test_api 0.3.0 [async boolean_selector collection meta path source_span stack_trace stream_channel string_scanner term_glyph matcher] - timing 1.0.0 [json_annotation] - typed_data 1.3.0 [collection] - vector_math 2.1.0 - watcher 1.0.0 [async path pedantic] - web_socket_channel 2.1.0 [async crypto stream_channel] - yaml 3.1.0 [collection source_span string_scanner] ```

markusaksli-nc commented 3 years ago

Hi @ParasGarg7 Which native platform is this for? Have you tried just completing the native setup steps in your native project? Thank you

ParasGarg7 commented 3 years ago

Hi @markusaksli-nc The native platforms I want them for are Android and iOS. Since the folders for these platforms are generated folders(.ios and .android), which get updated almost every time I run flutter pub get, I cannot do the native setup steps in them, coz if I make changes in them, they will be removed the next time flutter pub get decides to rewrite these folders. Also since they are not to be source controlled, I cannot commit the changes for other devs to use.

markusaksli-nc commented 3 years ago

I don't mean the native folders that are generated in the flutter project, I mean the native project you are adding the flutter module to.

ParasGarg7 commented 3 years ago

For the native side, I have completly implemented the Firebase Crashlytics setup, and am able to see the logs in the Firebase Console. But doing so, even if there is an exception in the Flutter side, they are neither reflected in the Non-fatals nor under Crashes.

russellwheatley commented 2 years ago

If you're running flutter pub get would you not just include the crashlytics plugin to the pubspec file? I don't see how else it would work if you wanted to use Crashlytics in your Flutter app.

google-oss-bot commented 2 years ago

Hey @ParasGarg7. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot commented 2 years ago

Since there haven't been any recent updates here, I am going to close this issue.

@ParasGarg7 if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.