Skip to content

[firebase_crashlytics]: firebase_crashlytics_collection_enabled setting in AndroidManifest.xml is being ignored #13105

Description

@zjcz

Is there an existing issue for this?

  • I have searched the existing issues.

Which plugins are affected?

Crashlytics

Which platforms are affected?

Android

Description

I want to be able to provide my users with the ability to opt-in to Crashlytics. Error reporting will be disabled by default and it will be turned on in code using FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(true) if the user has opted-in.

I have followed the guide Enable opt-in reporting to disable Crashlytics and added the config to my ~/android/app/src/main/AndroidManifest.xml file but crash reports are still being sent regardless. If I run the code FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(false) then crash reports are not sent, so I think the problem is with the plugin reading the setting from AndroidManifest.xml

This was working on May 22 2024 when I first added the feature to my app but has recently stopped working. I have created a new test app with just this functionality in to ensure no other plugins are interfering - firebase_sample.

Reproducing the issue

  • Create a new flutter application
  • Setup Firebase Crashlytics
  • Follow the steps at Enable opt-in reporting to add the firebase_crashlytics_collection_enabled = false setting to AndroidManifest.xml, but do not add the code FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(true);
  • Follow the steps at Test your Crashlytics implementation
  • Run the app and click the "Throw Test Exception" button to generate an exception. Check the Crashlytics dashboard.

Firebase Core version

3.2.0

Flutter Version

3.22.3

Relevant Log Output

No response

Flutter dependencies

Expand Flutter dependencies snippet
flutter pub deps -- --style=compact
Dart SDK 3.4.4
Flutter SDK 3.22.3
firebase_sample 1.0.0+1

dependencies:
- firebase_analytics 11.2.0 [firebase_analytics_platform_interface firebase_analytics_web firebase_core firebase_core_platform_interface flutter]
- firebase_core 3.2.0 [firebase_core_platform_interface firebase_core_web flutter meta]
- firebase_crashlytics 4.0.3 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace]
- flutter 0.0.0 [characters collection material_color_utilities meta vector_math sky_engine]

dev dependencies:
- flutter_lints 3.0.2 [lints]
- flutter_test 0.0.0 [flutter test_api matcher path fake_async clock stack_trace vector_math leak_tracker_flutter_testing async boolean_selector characters collection leak_tracker leak_tracker_testing material_color_utilities meta source_span stream_channel string_scanner term_glyph vm_service]

transitive dependencies:
- _flutterfire_internals 1.3.39 [collection firebase_core firebase_core_platform_interface flutter meta]
- async 2.11.0 [collection meta]
- boolean_selector 2.1.1 [source_span string_scanner]
- characters 1.3.0
- clock 1.1.1
- collection 1.18.0
- fake_async 1.3.1 [clock collection]
- firebase_analytics_platform_interface 4.2.0 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface]
- firebase_analytics_web 0.5.9 [_flutterfire_internals firebase_analytics_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins]
- firebase_core_platform_interface 5.1.0 [collection flutter flutter_test meta plugin_platform_interface]
- firebase_core_web 2.17.3 [firebase_core_platform_interface flutter flutter_web_plugins meta web]
- firebase_crashlytics_platform_interface 3.6.39 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface]
- flutter_web_plugins 0.0.0 [flutter characters collection material_color_utilities meta vector_math]
- leak_tracker 10.0.4 [clock collection meta path vm_service]
- leak_tracker_flutter_testing 3.0.3 [flutter leak_tracker leak_tracker_testing matcher meta]
- leak_tracker_testing 3.0.1 [leak_tracker matcher meta]
- lints 3.0.0
- matcher 0.12.16+1 [async meta stack_trace term_glyph test_api]
- material_color_utilities 0.8.0 [collection]
- meta 1.12.0
- path 1.9.0
- plugin_platform_interface 2.1.8 [meta]
- sky_engine 0.0.99
- source_span 1.10.0 [collection path term_glyph]
- stack_trace 1.11.1 [path]
- stream_channel 2.1.2 [async]
- string_scanner 1.2.0 [source_span]
- term_glyph 1.2.1
- test_api 0.7.0 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph]
- vector_math 2.1.4
- vm_service 14.2.1
- web 0.5.1

Additional context and comments

I have read previous issue [firebase_crashlytics] enable opt_in reporting not working correctly #6934 however I cannot find any resolution to this on the Android SDK repository, or any other similar recent issues. Also, as I am relatively new to Flutter there is a chance this is a user issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions