Skip to content

🐛 [firebase_analytics] Not working on Android with manual initialisation #10399

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

Closed
ljmatan opened this issue Feb 8, 2023 · 14 comments
Closed
Labels
platform: android Issues / PRs which are specifically for Android. plugin: analytics type: bug Something isn't working

Comments

@ljmatan
Copy link

ljmatan commented Feb 8, 2023

Bug report

Describe the bug
We're not receiving any analytics events from the Android platform. Neither the "manual" initialisation nor the CLI init seems to be working.


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 master, 3.8.0-7.0.pre.24, on macOS 12.5 21G72 darwin-arm64, locale en-HR)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.3)
[✓] VS Code (version 1.75.0)
[✓] VS Code (version 1.74.0-insider)
[✓] Connected device (3 available)
[✓] HTTP Host Availability

• No issues found!

Flutter dependencies

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

Click To Expand
Dart SDK 3.0.0-204.0.dev
Flutter SDK 3.8.0-7.0.pre.24
clickapo 1.0.1+1

dependencies:
- camera 0.10.0+4 [camera_android camera_avfoundation camera_platform_interface camera_web flutter flutter_plugin_android_lifecycle quiver]
- clickapo_chat 0.0.1 [flutter clickapo_rest_api socket_io_client linkify_text flutter_svg http open_filex share_plus path_provider]
- clickapo_rest_api 0.0.1 [flutter http json_annotation shared_preferences encrypt web_socket_channel flutter_secure_storage path_provider graphql]
- cupertino_icons 1.0.5
- device_info_plus 4.1.3 [flutter device_info_plus_platform_interface device_info_plus_macos device_info_plus_linux device_info_plus_web device_info_plus_windows]
- file_picker 4.6.1 [flutter flutter_web_plugins flutter_plugin_android_lifecycle plugin_platform_interface ffi path win32]
- firebase_analytics 10.1.0 [firebase_analytics_platform_interface firebase_analytics_web firebase_core firebase_core_platform_interface flutter]
- firebase_core 2.4.1 [firebase_core_platform_interface firebase_core_web flutter meta]
- firebase_messaging 14.2.1 [firebase_core firebase_core_platform_interface firebase_messaging_platform_interface firebase_messaging_web flutter meta]
- flutter 0.0.0 [characters collection js material_color_utilities meta vector_math sky_engine]
- flutter_html 2.1.5 [html csslib flutter]
- flutter_image_compress 1.1.3 [flutter]
- flutter_localizations 0.0.0 [flutter intl characters clock collection js material_color_utilities meta path vector_math]
- flutter_map 2.2.0 [async collection flutter http latlong2 meta polylabel positioned_tap_detector_2 proj4dart tuple vector_math]
- flutter_svg 1.1.6 [flutter meta path_drawing vector_math xml]
- geolocator 8.2.1 [flutter geolocator_platform_interface geolocator_android geolocator_apple geolocator_web geolocator_windows]
- google_mlkit_barcode_scanning 0.4.0 [flutter google_mlkit_commons]
- image 3.3.0 [archive meta xml]
- image_picker 0.8.6 [flutter image_picker_android image_picker_for_web image_picker_ios image_picker_platform_interface]
- in_app_review 2.0.6 [flutter in_app_review_platform_interface]
- linkfy_text 1.1.5 [flutter]
- local_auth 2.1.3 [flutter local_auth_android local_auth_ios local_auth_platform_interface local_auth_windows]
- open_filex 4.3.2 [flutter ffi]
- path 1.8.3
- path_provider 2.0.12 [flutter path_provider_android path_provider_foundation path_provider_linux path_provider_platform_interface path_provider_windows]
- permission_handler 10.2.0 [flutter meta permission_handler_android permission_handler_apple permission_handler_windows permission_handler_platform_interface]
- pool 1.5.1 [async stack_trace]
- share_plus 5.0.0 [cross_file meta mime flutter share_plus_platform_interface share_plus_linux share_plus_macos share_plus_windows share_plus_web]
- 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]
- socket_io_client 2.0.1 [logging socket_io_common js]
- sqflite 2.2.4+1 [flutter sqflite_common path]
- uni_links 0.5.1 [flutter uni_links_platform_interface uni_links_web]
- url_launcher 6.1.9 [flutter url_launcher_android url_launcher_ios url_launcher_linux url_launcher_macos url_launcher_platform_interface url_launcher_web url_launcher_windows]
- web_socket_channel 2.2.0 [async crypto stream_channel]
- webview_flutter 4.0.2 [flutter webview_flutter_android webview_flutter_platform_interface webview_flutter_wkwebview]

dev dependencies:
- alice 0.2.5 [flutter http dio flutter_local_notifications rxdart path_provider permission_handler package_info_plus share chopper collection]
- build_runner 2.4.0 [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]
- device_preview 1.1.0 [flutter flutter_localizations provider device_frame freezed_annotation json_annotation shared_preferences collection]
- flutter_lints 2.0.1 [lints]
- flutter_publishing_automation 0.0.1 [flutter file_picker shared_preferences]
- 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]
- integration_test 0.0.0 [flutter flutter_driver flutter_test path vm_service async boolean_selector characters clock collection fake_async file js matcher material_color_utilities meta source_span stack_trace stream_channel string_scanner sync_http term_glyph test_api vector_math webdriver]
- screenshot 1.3.0 [flutter]
- test 1.22.2 [analyzer async boolean_selector collection coverage http_multi_server io js node_preamble package_config path pool shelf shelf_packages_handler shelf_static shelf_web_socket source_span stack_trace stream_channel typed_data web_socket_channel webkit_inspection_protocol yaml test_api test_core]

dependency overrides:
- camera_android 0.10.0+1 [camera_platform_interface flutter flutter_plugin_android_lifecycle stream_transform]
- ffi 2.0.1
- permission_handler 10.2.0 [flutter meta permission_handler_android permission_handler_apple permission_handler_windows permission_handler_platform_interface]
- share_plus 5.0.0 [cross_file meta mime flutter share_plus_platform_interface share_plus_linux share_plus_macos share_plus_windows share_plus_web]

transitive dependencies:
- _fe_analyzer_shared 47.0.0 [meta]
- _flutterfire_internals 1.0.12 [collection firebase_core firebase_core_platform_interface flutter meta]
- analyzer 4.7.0 [_fe_analyzer_shared collection convert crypto glob meta package_config path pub_semver source_span watcher yaml]
- archive 3.3.6 [crypto path pointycastle]
- args 2.3.2
- asn1lib 1.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.0.10 [analyzer async build 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]
- camera_avfoundation 0.9.11 [camera_platform_interface flutter stream_transform]
- camera_platform_interface 2.4.0 [cross_file flutter plugin_platform_interface stream_transform]
- camera_web 0.3.1+1 [camera_platform_interface flutter flutter_web_plugins stream_transform]
- characters 1.2.1
- checked_yaml 2.0.2 [json_annotation source_span yaml]
- chopper 4.0.6 [http meta logging]
- clock 1.1.1
- code_builder 4.4.0 [built_collection built_value collection matcher meta]
- collection 1.17.1
- convert 3.1.1 [typed_data]
- coverage 1.6.3 [args logging package_config path source_maps stack_trace vm_service]
- cross_file 0.3.3+4 [js meta]
- crypto 3.0.2 [typed_data]
- csslib 0.17.2 [source_span]
- dart_style 2.2.4 [analyzer args path pub_semver source_span]
- dbus 0.7.8 [args ffi meta xml]
- device_frame 1.1.0 [freezed_annotation flutter]
- device_info_plus_linux 3.0.0 [device_info_plus_platform_interface file flutter meta]
- device_info_plus_macos 3.0.0 [device_info_plus_platform_interface flutter]
- device_info_plus_platform_interface 3.0.0 [flutter meta plugin_platform_interface]
- device_info_plus_web 3.0.0 [device_info_plus_platform_interface flutter_web_plugins flutter]
- device_info_plus_windows 4.1.0 [device_info_plus_platform_interface ffi flutter win32]
- dio 4.0.6 [http_parser path]
- encrypt 5.0.1 [args asn1lib clock collection crypto pointycastle]
- fake_async 1.3.1 [clock collection]
- file 6.1.4 [meta path]
- firebase_analytics_platform_interface 3.3.17 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface]
- firebase_analytics_web 0.5.1+8 [_flutterfire_internals firebase_analytics_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins js]
- firebase_core_platform_interface 4.5.2 [collection flutter flutter_test meta plugin_platform_interface]
- firebase_core_web 2.1.0 [firebase_core_platform_interface flutter flutter_web_plugins js meta]
- firebase_messaging_platform_interface 4.2.10 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface]
- firebase_messaging_web 3.2.11 [_flutterfire_internals firebase_core firebase_core_web firebase_messaging_platform_interface flutter flutter_web_plugins js meta]
- fixnum 1.1.0
- flutter_driver 0.0.0 [file flutter flutter_test fuchsia_remote_debug_protocol path meta vm_service webdriver async boolean_selector characters clock collection js matcher material_color_utilities platform process source_span stack_trace stream_channel string_scanner sync_http term_glyph test_api vector_math]
- flutter_local_notifications 9.9.1 [clock flutter flutter_local_notifications_linux flutter_local_notifications_platform_interface timezone]
- flutter_local_notifications_linux 0.5.1 [flutter flutter_local_notifications_platform_interface dbus path xdg_directories]
- flutter_local_notifications_platform_interface 5.0.0 [flutter plugin_platform_interface]
- flutter_plugin_android_lifecycle 2.0.7 [flutter]
- flutter_secure_storage 6.1.0 [flutter flutter_secure_storage_linux flutter_secure_storage_macos flutter_secure_storage_platform_interface flutter_secure_storage_web flutter_secure_storage_windows meta]
- flutter_secure_storage_linux 1.1.2 [flutter flutter_secure_storage_platform_interface]
- flutter_secure_storage_macos 1.1.2 [flutter flutter_secure_storage_platform_interface]
- flutter_secure_storage_platform_interface 1.0.1 [flutter plugin_platform_interface]
- flutter_secure_storage_web 1.1.1 [flutter flutter_secure_storage_platform_interface flutter_web_plugins js]
- flutter_secure_storage_windows 1.1.3 [flutter flutter_secure_storage_platform_interface]
- flutter_web_plugins 0.0.0 [flutter js characters collection material_color_utilities meta vector_math]
- freezed_annotation 2.2.0 [collection json_annotation meta]
- frontend_server_client 3.2.0 [async path]
- fuchsia_remote_debug_protocol 0.0.0 [process vm_service file meta path platform]
- geolocator_android 3.2.1 [flutter geolocator_platform_interface]
- geolocator_apple 2.2.5 [flutter geolocator_platform_interface]
- geolocator_platform_interface 4.0.7 [flutter plugin_platform_interface vector_math meta]
- geolocator_web 2.1.6 [flutter flutter_web_plugins geolocator_platform_interface]
- geolocator_windows 0.1.1 [flutter geolocator_platform_interface]
- glob 2.1.1 [async collection file path string_scanner]
- google_mlkit_commons 0.2.0 [flutter]
- gql 0.14.0 [collection meta source_span]
- gql_dedupe_link 2.0.3+1 [async gql_exec gql_link meta]
- gql_error_link 0.2.3+1 [async gql_exec gql_link meta]
- gql_exec 0.4.3 [collection gql meta]
- gql_http_link 0.4.5 [gql gql_exec gql_link http http_parser meta]
- gql_link 0.5.1 [gql gql_exec meta]
- gql_transform_link 0.2.2+1 [gql_exec gql_link]
- graphql 5.1.3 [meta path gql gql_exec gql_link gql_http_link gql_transform_link gql_error_link gql_dedupe_link hive normalize http collection web_socket_channel stream_channel rxdart uuid]
- graphs 2.2.0 [collection]
- hive 2.2.3 [meta crypto]
- html 0.15.1 [csslib source_span]
- http 0.13.5 [async http_parser meta path]
- http_multi_server 3.2.1 [async]
- http_parser 4.0.2 [collection source_span string_scanner typed_data]
- image_picker_android 0.8.5+5 [flutter flutter_plugin_android_lifecycle image_picker_platform_interface]
- image_picker_for_web 2.1.10 [flutter flutter_web_plugins image_picker_platform_interface]
- image_picker_ios 0.8.6+7 [flutter image_picker_platform_interface]
- image_picker_platform_interface 2.6.2 [cross_file flutter http plugin_platform_interface]
- in_app_review_platform_interface 2.0.4 [flutter url_launcher plugin_platform_interface platform]
- intl 0.18.0 [clock meta path]
- io 1.0.4 [meta path string_scanner]
- js 0.6.7 [meta]
- json_annotation 4.8.0 [meta]
- latlong2 0.8.1 [intl]
- linkify_text 0.0.9 [flutter url_launcher]
- lints 2.0.1
- lists 1.0.1 [meta]
- local_auth_android 1.0.18 [flutter flutter_plugin_android_lifecycle intl local_auth_platform_interface]
- local_auth_ios 1.0.12 [flutter intl local_auth_platform_interface]
- local_auth_platform_interface 1.0.6 [flutter plugin_platform_interface]
- local_auth_windows 1.0.5 [flutter local_auth_platform_interface]
- logging 1.1.1
- matcher 0.12.14 [meta stack_trace]
- material_color_utilities 0.2.0
- meta 1.9.0
- mgrs_dart 2.0.0 [unicode]
- mime 1.0.4
- nested 1.0.0 [flutter]
- node_preamble 2.0.1
- normalize 0.7.2 [gql collection]
- package_config 2.1.0 [path]
- package_info_plus 1.4.3+1 [flutter package_info_plus_platform_interface package_info_plus_linux package_info_plus_macos package_info_plus_windows package_info_plus_web]
- package_info_plus_linux 1.0.5 [package_info_plus_platform_interface flutter path]
- package_info_plus_macos 1.3.0 [flutter]
- package_info_plus_platform_interface 1.0.2 [flutter meta plugin_platform_interface]
- package_info_plus_web 1.0.6 [flutter flutter_web_plugins http meta package_info_plus_platform_interface]
- package_info_plus_windows 2.1.0 [package_info_plus_platform_interface ffi flutter win32]
- path_drawing 1.0.1 [vector_math meta path_parsing flutter]
- path_parsing 1.0.1 [vector_math meta]
- path_provider_android 2.0.22 [flutter path_provider_platform_interface]
- path_provider_foundation 2.1.1 [flutter path_provider_platform_interface]
- path_provider_linux 2.1.7 [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]
- permission_handler_android 10.2.0 [flutter permission_handler_platform_interface]
- permission_handler_apple 9.0.7 [flutter permission_handler_platform_interface]
- permission_handler_platform_interface 3.9.0 [flutter meta plugin_platform_interface]
- permission_handler_windows 0.1.2 [flutter permission_handler_platform_interface]
- petitparser 5.1.0 [meta]
- platform 3.1.0
- plugin_platform_interface 2.1.3 [meta]
- pointycastle 3.6.2 [collection convert js]
- polylabel 1.0.1 [collection]
- positioned_tap_detector_2 1.0.4 [flutter]
- process 4.2.4 [file path platform]
- proj4dart 2.1.0 [mgrs_dart wkt_parser meta]
- provider 6.0.5 [collection flutter nested]
- pub_semver 2.1.3 [collection meta]
- pubspec_parse 1.2.1 [checked_yaml collection json_annotation pub_semver yaml]
- quiver 3.2.1 [matcher]
- rxdart 0.27.7
- share 2.0.4 [meta mime flutter]
- share_plus_linux 3.0.1 [cross_file share_plus_platform_interface file flutter meta url_launcher]
- share_plus_macos 3.0.1 [share_plus_platform_interface flutter]
- share_plus_platform_interface 3.2.0 [cross_file flutter meta mime plugin_platform_interface path_provider uuid]
- share_plus_web 3.1.0 [cross_file share_plus_platform_interface url_launcher flutter flutter_web_plugins meta mime]
- share_plus_windows 4.0.0 [cross_file share_plus_platform_interface flutter meta url_launcher ffi win32]
- 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_packages_handler 3.0.1 [path shelf shelf_static]
- shelf_static 1.1.1 [convert http_parser mime path shelf]
- shelf_web_socket 1.0.3 [shelf stream_channel web_socket_channel]
- sky_engine 0.0.99
- socket_io_common 2.0.2 [logging]
- source_map_stack_trace 2.1.1 [path source_maps stack_trace]
- source_maps 0.10.11 [source_span]
- source_span 1.9.1 [collection path term_glyph]
- sqflite_common 2.4.2+2 [synchronized path meta]
- stack_trace 1.11.0 [path]
- stream_channel 2.1.1 [async]
- stream_transform 2.1.0
- string_scanner 1.2.0 [source_span]
- sync_http 0.3.1
- synchronized 3.0.1
- term_glyph 1.2.1
- test_api 0.4.18 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph matcher]
- test_core 0.4.22 [analyzer async args boolean_selector collection coverage frontend_server_client glob io meta package_config path pool source_map_stack_trace source_maps source_span stack_trace stream_channel vm_service yaml matcher test_api]
- timezone 0.8.0 [path]
- timing 1.0.1 [json_annotation]
- tuple 2.0.1
- typed_data 1.3.1 [collection]
- uni_links_platform_interface 1.0.0 [flutter plugin_platform_interface]
- uni_links_web 0.1.0 [flutter flutter_web_plugins uni_links_platform_interface]
- unicode 0.3.1 [lists]
- url_launcher_android 6.0.23 [flutter url_launcher_platform_interface]
- url_launcher_ios 6.1.0 [flutter url_launcher_platform_interface]
- url_launcher_linux 3.0.2 [flutter url_launcher_platform_interface]
- url_launcher_macos 3.0.2 [flutter url_launcher_platform_interface]
- url_launcher_platform_interface 2.1.1 [flutter plugin_platform_interface]
- url_launcher_web 2.0.14 [flutter flutter_web_plugins url_launcher_platform_interface]
- url_launcher_windows 3.0.3 [flutter url_launcher_platform_interface]
- uuid 3.0.7 [crypto]
- vector_math 2.1.4
- vm_service 10.1.2
- watcher 1.0.2 [async path]
- webdriver 3.0.2 [matcher path stack_trace sync_http]
- webkit_inspection_protocol 1.2.0 [logging]
- webview_flutter_android 3.2.4 [flutter webview_flutter_platform_interface]
- webview_flutter_platform_interface 2.0.1 [flutter meta plugin_platform_interface]
- webview_flutter_wkwebview 3.0.5 [flutter path webview_flutter_platform_interface]
- win32 2.7.0 [ffi]
- wkt_parser 2.0.0
- xdg_directories 0.2.0+3 [meta path process]
- xml 6.2.2 [collection meta petitparser]
- yaml 3.1.1 [collection source_span string_scanner]

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

@ljmatan
I believe you are hitting #10120, so please follow-up in that issue for further updates.
Closing this as duplicate.

@darshankawar darshankawar added resolution: duplicate This issue or pull request already exists Needs Attention This issue needs maintainer attention. triage Issue is currently being triaged. and removed Needs Attention This issue needs maintainer attention. triage Issue is currently being triaged. labels Feb 8, 2023
@ljmatan
Copy link
Author

ljmatan commented Feb 8, 2023

@darshankawar the workaround suggested in another issue:

Platform.isAndroid
          ? await Firebase.initializeApp()
          : await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);

is not working. Please reopen.

@darshankawar
Copy link

@ljmatan
Can you check this comment and see if it helps ?

@ljmatan
Copy link
Author

ljmatan commented Feb 9, 2023

Hi @darshankawar

No, that actually did not help (I've done it twice), and I'm unsure of what other info I can provide you with.

@darshankawar
Copy link

Have you already followed the documentation ?
Also check #8767 (comment)

@ljmatan
Copy link
Author

ljmatan commented Feb 13, 2023

Hi @darshankawar

Both were covered by me, yes. When the app is started, I see no errors in the console and I can see all of the objects as being successfully initialised. For example, FirebaseAnalytics.instanceFor(app: await Firebase.initializeApp()) or FirebaseAnalytics.instanceFor(app: await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform)) don't throw any errors.

@rjduffsep
Copy link

I can also not use Google Analytics on Android in one of my projects after running flutterfire configure. I am getting the Missing google_app_id. Firebase Analytics disabled. error.

I can connect to Analytics with the web version of the project in Chrome and see the expected events (navigating pages and a dummy button that does a starting cart event), but not via an Pixel 3 emulator or a real Pixel 3 over USB.

The SHA1 fingerprint from the signingReport has been entered for the app on Firebase.

@ljmatan
Copy link
Author

ljmatan commented Feb 14, 2023

@darshankawar please reopen the ticket, clearly there's a lot of people having issues with the plugin.

@darshankawar darshankawar reopened this Feb 14, 2023
@darshankawar darshankawar removed the resolution: duplicate This issue or pull request already exists label Feb 14, 2023
@darshankawar
Copy link

@rjduffsep
Missing google_app_id. Firebase Analytics disabled indicates your app_id is missing. Please check your google-services.json file. In it, mobilesdk_app_id is your app_id.

"client_info": {
        "mobilesdk_app_id":

Also make sure you're applying this at the bottom of your app/build.gradle:

apply plugin: 'com.google.gms.google-services'

You will also need this:

classpath 'com.google.gms:google-services:4.3.10'

as a dependency in your android/build.gradle.

@ljmatan Please check above in your case too.

@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 Feb 14, 2023
@ljmatan
Copy link
Author

ljmatan commented Feb 14, 2023

Hi @darshankawar

Our google-services.json file is located in the android/app/ folder, and it incldues the mobilesdk_app_id bit.

We have this in android/build.gradle file:
classpath 'com.google.gms:google-services:4.3.14'

In our android/app/build.gradle file, we have this:
apply plugin: 'com.google.gms.google-services'

On the bottom we also have:

    implementation platform('com.google.firebase:firebase-bom:28.4.1')
    implementation 'com.google.firebase:firebase-analytics'
    implementation 'com.google.firebase:firebase-messaging'

@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 Feb 14, 2023
@rjduffsep
Copy link

classpath 'com.google.gms:google-services:4.3.10'

The apply plugin and classpath additions healed my application. With the exception of a gradle build error fixed by advancing the goggle-services library to 4.3.14 as described here.

Thank you for your help.

For my own edification, what step did I miss that should have brought in those two elements into the gradle files?

@darshankawar
Copy link

what step did I miss that should have brought in those two elements into the gradle files?

flutterfire configure adds these steps for you so actually speaking, there are no manual steps left because the CLI writes respective config files to platform specific directories.
This documentation should help to setup analytics: https://firebase.google.com/docs/analytics/get-started?platform=flutter

@darshankawar
Copy link

darshankawar commented Feb 15, 2023

For @ljmatan's report, I'll keep this issue open for team's insights on originally reported behavior.
Updating issue title to reflect the manual part only.

@darshankawar darshankawar changed the title 🐛 [firebase_analytics] Not working on Android with manual and dart-only initialisation 🐛 [firebase_analytics] Not working on Android with manual initialisation Feb 15, 2023
@darshankawar darshankawar added platform: android Issues / PRs which are specifically for Android. and removed Needs Attention This issue needs maintainer attention. triage Issue is currently being triaged. labels Feb 15, 2023
@russellwheatley
Copy link
Member

We advise initialising your application using the service files. This is why when you run the current version of flutterfire configure, it adds them to you project. For further details, please see this comment on the FlutterFire CLI repo.

@firebase firebase locked and limited conversation to collaborators Mar 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform: android Issues / PRs which are specifically for Android. plugin: analytics type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants