Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 [firebase_analytics] No events on DebugView when testing on iOS #11780

Closed
deandreamatias-worldline opened this issue Oct 26, 2023 · 9 comments
Labels
blocked: flutter platform: ios Issues / PRs which are specifically for iOS. plugin: analytics resolution: invalid This doesn't seem right and might not belong here. type: bug Something isn't working

Comments

@deandreamatias-worldline

Bug report

Describe the bug
After configure the debug mode for Firebase Analytics for iOS, on DebugView do not show the events.
Follow this official documentation and this StackOverflow answer
When launch app directly from XCode, works fine.

Related to issues (all closed without solution)

Steps to reproduce

  1. Integrate Firebase core + Firebase analytics, verify the app keys and configures
  2. Enable debug mode. Open Xcode. SelctProduct->Scheme > Edit scheme. Select Run from the left menu. Select the Arguments tab. In the Arguments Passed On Launch section, add -FIRDebugEnabled or -FIRAnalyticsDebugEnabled (tested both).
  3. Try to build project by VS Code (see launch configuration)
  4. Check the Debug View and the no event emitted from the project built by VS Code.

Expected behavior

When enable debug mode, show the events on DebugView of Firebase.

Sample project

Use the example code of package and add a configuration to enable debug view


Additional context

launch.json configuration

        {
            "name": "DEV",
            "request": "launch",
            "type": "dart",
            "args": [
                "--flavor",
                "dev",
                "--dart-define-from-file=.env/dev.json"
            ]
        },

Flutter doctor

Run flutter doctor and paste the output below:

Click To Expand
[✓] Flutter (Channel stable, 3.10.6, on macOS 13.6 22G120 darwin-arm64, locale en-ES)
    • Flutter version 3.10.6 on channel stable at /Users/matias/fvm/3.10.6
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f468f3366c (4 months ago), 2023-07-12 15:19:05 -0700
    • Engine revision cdbeda788a
    • Dart version 3.0.6
    • DevTools version 2.23.1

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/matias/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/matias/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15A240d
    • CocoaPods version 1.13.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.3)
    • Android Studio at /Applications/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 17.0.6+0-17.0.6b829.9-10027231)

[✓] VS Code (version 1.83.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.74.0

[✓] Connected device (5 available)
    • sdk gphone64 arm64 (mobile)         • emulator-5554                        • android-arm64  • Android 13 (API 33) (emulator)
    • iPhone SE (3rd generation) (mobile) • 8453D6BA-DE59-441E-B2C7-5F6ADAD42CB4 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-17-0 (simulator)
    • iPhone 15 Pro (mobile)              • 4549D471-B7E2-4801-8A40-2C6DAA2DEAAF • ios            • com.apple.CoreSimulator.SimRuntime.iOS-17-0 (simulator)
    • macOS (desktop)                     • macos                                • darwin-arm64   • macOS 13.6 22G120 darwin-arm64
    • Chrome (web)                        • chrome                               • web-javascript • Google Chrome 118.0.5993.117

[✓] Network resources
    • All expected network resources are available.

• No issues found!

Flutter dependencies

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

Click To Expand
- common_module_flutter 5.0.4 [flutter]
- cross_file 0.3.3+6 [js meta]
- dio 5.3.3 [async http_parser meta path]
- easy_localization 3.0.3 [flutter shared_preferences intl args path easy_logger flutter_localizations]
- either_dart 1.0.0
- firebase_analytics 10.6.2 [firebase_analytics_platform_interface firebase_analytics_web firebase_core firebase_core_platform_interface flutter]
- firebase_core 2.20.0 [firebase_core_platform_interface firebase_core_web flutter meta]
- firebase_crashlytics 3.4.2 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace]
- firebase_performance 0.9.3+2 [firebase_core firebase_core_platform_interface firebase_performance_platform_interface firebase_performance_web flutter]
- firebase_remote_config 4.3.2 [firebase_core firebase_core_platform_interface firebase_remote_config_platform_interface firebase_remote_config_web flutter]
- flutter 0.0.0 [characters collection js material_color_utilities meta vector_math sky_engine]
- flutter_bloc 8.1.3 [bloc flutter provider]
- flutter_fgbg 0.3.0 [flutter]
- flutter_native_splash 2.3.4 [args flutter flutter_web_plugins js html image meta path universal_io xml yaml]
- get_it 7.6.4 [async collection]
- go_router 12.0.0 [collection flutter flutter_web_plugins logging meta]
- injectable 2.3.2 [get_it]
- path_provider 2.1.1 [flutter path_provider_android path_provider_foundation path_provider_linux path_provider_platform_interface path_provider_windows]
- permission_handler 11.0.1 [flutter meta permission_handler_android permission_handler_apple permission_handler_windows permission_handler_platform_interface]
- shared_preferences 2.2.2 [flutter shared_preferences_android shared_preferences_foundation shared_preferences_linux shared_preferences_platform_interface shared_preferences_web shared_preferences_windows]
- url_launcher 6.1.14 [flutter url_launcher_android url_launcher_ios url_launcher_linux url_launcher_macos url_launcher_platform_interface url_launcher_web url_launcher_windows]

dev dependencies:
- build_runner 2.4.6 [analyzer args async 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 3.0.0 [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]
- injectable_generator 2.4.1 [build source_gen path glob analyzer code_builder dart_style injectable collection recase meta]

transitive dependencies:
- _fe_analyzer_shared 64.0.0 [meta]
- _flutterfire_internals 1.3.10 [collection firebase_core firebase_core_platform_interface flutter meta]
- analyzer 6.2.0 [_fe_analyzer_shared collection convert crypto glob meta package_config path pub_semver source_span watcher yaml]
- archive 3.4.6 [crypto path pointycastle]
- args 2.4.2
- async 2.11.0 [collection meta]
- bloc 8.1.2 [meta]
- boolean_selector 2.1.1 [source_span string_scanner]
- build 2.4.1 [analyzer async convert crypto glob logging meta package_config path]
- build_config 1.1.1 [checked_yaml json_annotation path pubspec_parse yaml]
- build_daemon 4.0.0 [built_collection built_value http_multi_server logging path pool shelf shelf_web_socket stream_transform watcher web_socket_channel]
- build_resolvers 2.4.1 [analyzer async build collection convert crypto graphs logging package_config path pool pub_semver stream_transform yaml]
- build_runner_core 7.2.11 [async build build_config build_resolvers collection convert crypto glob graphs json_annotation logging meta package_config path pool timing watcher yaml]
- built_collection 5.1.1
- built_value 8.6.3 [built_collection collection fixnum meta]
- characters 1.3.0
- checked_yaml 2.0.3 [json_annotation source_span yaml]
- clock 1.1.1
- code_builder 4.7.0 [built_collection built_value collection matcher meta]
- collection 1.17.1
- convert 3.1.1 [typed_data]
- crypto 3.0.3 [typed_data]
- csslib 1.0.0 [source_span]
- dart_style 2.3.3 [analyzer args path pub_semver source_span]
- easy_logger 0.0.2 [flutter]
- fake_async 1.3.1 [clock collection]
- ffi 2.1.0
- file 7.0.0 [meta path]
- firebase_analytics_platform_interface 3.7.4 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface]
- firebase_analytics_web 0.5.5+4 [_flutterfire_internals firebase_analytics_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins js]
- firebase_core_platform_interface 5.0.0 [collection flutter flutter_test meta plugin_platform_interface]
- firebase_core_web 2.8.1 [firebase_core_platform_interface flutter flutter_web_plugins js meta]
- firebase_crashlytics_platform_interface 3.6.10 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface]
- firebase_performance_platform_interface 0.1.4+10 [_flutterfire_internals firebase_core flutter plugin_platform_interface]
- firebase_performance_web 0.1.4+10 [_flutterfire_internals firebase_core firebase_core_web firebase_performance_platform_interface flutter flutter_web_plugins js]
- firebase_remote_config_platform_interface 1.4.10 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface]
- firebase_remote_config_web 1.4.10 [firebase_core firebase_core_web firebase_remote_config_platform_interface flutter flutter_web_plugins js]
- fixnum 1.1.0
- flutter_localizations 0.0.0 [flutter intl characters clock collection js material_color_utilities meta path vector_math]
- 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.2 [async collection file path string_scanner]
- graphs 2.3.1 [collection]
- html 0.15.4 [csslib source_span]
- http_multi_server 3.2.1 [async]
- http_parser 4.0.2 [collection source_span string_scanner typed_data]
- image 4.1.3 [archive meta xml]
- intl 0.18.0 [clock meta path]
- io 1.0.4 [meta path string_scanner]
- js 0.6.7 [meta]
- json_annotation 4.8.1 [meta]
- lints 3.0.0
- logging 1.2.0
- matcher 0.12.15 [async meta stack_trace term_glyph test_api]
- material_color_utilities 0.2.0
- meta 1.9.1
- mime 1.0.4
- nested 1.0.0 [flutter]
- package_config 2.1.0 [path]
- path 1.8.3
- path_provider_android 2.2.1 [flutter path_provider_platform_interface]
- path_provider_foundation 2.3.1 [flutter path_provider_platform_interface]
- path_provider_linux 2.2.1 [ffi flutter path path_provider_platform_interface xdg_directories]
- path_provider_platform_interface 2.1.1 [flutter platform plugin_platform_interface]
- path_provider_windows 2.2.1 [ffi flutter path path_provider_platform_interface win32]
- permission_handler_android 11.1.0 [flutter permission_handler_platform_interface]
- permission_handler_apple 9.1.4 [flutter permission_handler_platform_interface]
- permission_handler_platform_interface 3.12.0 [flutter meta plugin_platform_interface]
- permission_handler_windows 0.1.3 [flutter permission_handler_platform_interface]
- petitparser 5.4.0 [meta]
- platform 3.1.3
- plugin_platform_interface 2.1.6 [meta]
- pointycastle 3.7.3 [collection convert js]
- pool 1.5.1 [async stack_trace]
- provider 6.0.5 [collection flutter nested]
- pub_semver 2.1.4 [collection meta]
- pubspec_parse 1.2.3 [checked_yaml collection json_annotation pub_semver yaml]
- recase 4.1.0
- shared_preferences_android 2.2.1 [flutter shared_preferences_platform_interface]
- shared_preferences_foundation 2.3.4 [flutter shared_preferences_platform_interface]
- shared_preferences_linux 2.3.2 [file flutter path path_provider_linux path_provider_platform_interface shared_preferences_platform_interface]
- shared_preferences_platform_interface 2.3.1 [flutter plugin_platform_interface]
- shared_preferences_web 2.2.1 [flutter flutter_web_plugins shared_preferences_platform_interface]
- shared_preferences_windows 2.3.2 [file flutter path path_provider_platform_interface path_provider_windows shared_preferences_platform_interface]
- shelf 1.4.1 [async collection http_parser path stack_trace stream_channel]
- shelf_web_socket 1.0.4 [shelf stream_channel web_socket_channel]
- sky_engine 0.0.99
- source_gen 1.4.0 [analyzer async build dart_style glob path source_span yaml]
- source_span 1.9.1 [collection path term_glyph]
- stack_trace 1.11.0 [path]
- 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.5.1 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph matcher]
- timing 1.0.1 [json_annotation]
- typed_data 1.3.2 [collection]
- universal_io 2.2.2 [collection meta typed_data]
- url_launcher_android 6.2.0 [flutter url_launcher_platform_interface]
- url_launcher_ios 6.2.0 [flutter url_launcher_platform_interface]
- url_launcher_linux 3.1.0 [flutter url_launcher_platform_interface]
- url_launcher_macos 3.1.0 [flutter url_launcher_platform_interface]
- url_launcher_platform_interface 2.2.0 [flutter plugin_platform_interface]
- url_launcher_web 2.0.19 [flutter flutter_web_plugins url_launcher_platform_interface]
- url_launcher_windows 3.1.0 [flutter url_launcher_platform_interface]
- vector_math 2.1.4
- watcher 1.1.0 [async path]
- web_socket_channel 2.4.0 [async crypto stream_channel]
- win32 5.0.9 [ffi]
- xdg_directories 1.0.3 [meta path]
- xml 6.3.0 [collection meta petitparser]
- yaml 3.1.2 [collection source_span string_scanner]

@deandreamatias-worldline deandreamatias-worldline added Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels Oct 26, 2023
@darshankawar darshankawar added the triage Issue is currently being triaged. label Oct 26, 2023
@darshankawar
Copy link

Thanks for the report @deandreamatias-worldline
As I understand, it occurs as expected if you run through XCode, but not when you try to run via VSCode. Is it a correct interpretation ?

Also, if you try to run directly via command line or terminal, can you check if it works or not ?

@darshankawar darshankawar added blocked: customer-response Waiting for customer response, e.g. more information was requested. and removed Needs Attention This issue needs maintainer attention. labels Oct 26, 2023
@deandreamatias-worldline
Copy link
Author

Thats is correct @darshankawar.
What is the command that I can use to pass iOS arguments via Flutter CLI?

@google-oss-bot google-oss-bot added Needs Attention This issue needs maintainer attention. and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. labels Oct 26, 2023
@darshankawar
Copy link

What is the command that I can use to pass iOS arguments via Flutter CLI?

I am not completely sure, but maybe using flavors could be one of the options.

Using example project, do you see the log entries such as [FirebaseAnalytics] ? If so, that might indicate the events maybe logging but may not be showing in analytics dashboard in firebase console ?

@darshankawar darshankawar added blocked: customer-response Waiting for customer response, e.g. more information was requested. and removed Needs Attention This issue needs maintainer attention. labels Oct 27, 2023
@deandreamatias-worldline
Copy link
Author

I used flavors to build app, but this config need to update XCode config like this. So, do not have option to pass -FIRDebugEnabled directly by FlutterCLI

@google-oss-bot google-oss-bot added Needs Attention This issue needs maintainer attention. and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. labels Oct 27, 2023
@darshankawar
Copy link

Thanks for the update. I don't use VSCode IDE so unable to verify it properly, but based on the report, keeping it open for team's attention / tracking.

@darshankawar darshankawar added plugin: analytics platform: ios Issues / PRs which are specifically for iOS. and removed Needs Attention This issue needs maintainer attention. triage Issue is currently being triaged. labels Oct 27, 2023
@russellwheatley
Copy link
Member

Hey @deandreamatias-worldline, there is no way to pass this argument -FIRDebugEnabled from the Flutter CLI. There was an issue on the Flutter repo which was closed and moved to this repo: flutter/flutter#17043

it is handled by the native Firebase SDK on launch, and AFAIK, cannot be changed retroactively via FlutterFire.

At the moment, you do have to run the app from Xcode unfortunately, there is no way around it.

@deandreamatias-worldline
Copy link
Author

Ok. Thanks @russellwheatley for explanation

@TarekkMA
Copy link
Contributor

TarekkMA commented Jun 27, 2024

@deandreamatias-worldline

Thank you for your report! This issue isn't on FlutterFire, but rather on Flutter itself. Please file an issue on Flutter to allow Xcode command line arguments. If you feel that this issue is still relevant after that, please feel free to open a new issue with updated context. We appreciate your understanding and support.

@TarekkMA
Copy link
Contributor

And I see that the linked flutter issue has been closed

@TarekkMA TarekkMA added the resolution: invalid This doesn't seem right and might not belong here. label Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked: flutter platform: ios Issues / PRs which are specifically for iOS. plugin: analytics resolution: invalid This doesn't seem right and might not belong here. type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants