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.64k stars 3.96k forks source link

🐛 [firebase-analytics] Adding Firebase Analytics dependency causes FATAL crash to SOME Android devices #11483

Closed Fernandomr88 closed 3 months ago

Fernandomr88 commented 1 year ago

Bug report

Describe the bug The app loads up on an android real device for a second and immediately crashes. I'm using version 10.4.5 and this has been happening since version 10.4.3. This only happens on some random REAL devices, as shown in this Firebase TestLab screenshot. I wasn't yet able to reproduce in any emulator.

image

there's a video of the test and some outputs too.

Firebase TestLab outputs and video

Video:

https://github.com/firebase/flutterfire/assets/14304128/ed103544-0bec-4464-908b-b36d277d9d39

Report of one of the devices:

Click To Expand > at com.google.android.gms.internal.measurement.B0.run(Unknown Source:12) > FATAL EXCEPTION: ScionFrontendApi > Process: com.xxx.app, PID: 31811 > java.lang.ExceptionInInitializerError > at com.google.android.gms.measurement.internal.C2.(Unknown Source:34) > at com.google.android.gms.measurement.internal.S1.(Unknown Source:183) > at com.google.android.gms.measurement.internal.S1.G(Unknown Source:58) > at com.google.android.gms.measurement.internal.AppMeasurementDynamiteService.initialize(Unknown Source:17) > at com.google.android.gms.internal.measurement.o0.a(Unknown Source:108) > at com.google.android.gms.internal.measurement.B0.run(Unknown Source:12) > at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) > at java.lang.Thread.run(Thread.java:919) > Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodException: E0.h.values [] > at java.lang.Enum.enumValues(Enum.java:270) > at java.lang.Enum.access$000(Enum.java:61) > at java.lang.Enum$1.create(Enum.java:277) > at java.lang.Enum$1.create(Enum.java:275) > at libcore.util.BasicLruCache.get(BasicLruCache.java:63) > at java.lang.Enum.getSharedConstants(Enum.java:289) > at java.lang.Class.getEnumConstantsShared(Class.java:2428) > at java.util.EnumMap.getKeyUniverse(EnumMap.java:755) > at java.util.EnumMap.(EnumMap.java:138) > at E0.i.(Unknown Source:7) > at E0.i.(Unknown Source:5) > ... 9 more > Caused by: java.lang.NoSuchMethodException: E0.h.values [] > at java.lang.Class.getMethod(Class.java:2072) > at java.lang.Class.getDeclaredMethod(Class.java:2050) > at java.lang.Enum.enumValues(Enum.java:267) > ... 19 more And one more detailed report ``` 08-16 15:04:29.962: W/FA(31811): Error with data collection. Data lost. 08-16 15:04:29.962: W/FA(31811): java.lang.IllegalStateException: Attempting to perform action before initialize. 08-16 15:04:29.962: W/FA(31811): at com.google.android.gms.measurement.internal.AppMeasurementDynamiteService.d(Unknown Source:9) 08-16 15:04:29.962: W/FA(31811): at com.google.android.gms.measurement.internal.AppMeasurementDynamiteService.logHealthData(Unknown Source:0) 08-16 15:04:29.962: W/FA(31811): at com.google.android.gms.internal.measurement.u0.a(Unknown Source:27) 08-16 15:04:29.962: W/FA(31811): at com.google.android.gms.internal.measurement.B0.run(Unknown Source:12) 08-16 15:04:29.962: W/FA(31811): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 08-16 15:04:29.962: W/FA(31811): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 08-16 15:04:29.962: W/FA(31811): at java.lang.Thread.run(Thread.java:919) 08-16 15:04:29.965: D/ConnectivityService(4127): filterNetworkStateForUid() uid: 10092, pid: 31619 08-16 15:04:29.966: D/ConnectivityService(4127): filterNetworkStateForUid() uid: 10092, pid: 31619, networkInfo: [type: WIFI[], state: CONNECTED/CONNECTED, reason: (unspecified), extra: (none), failover: false, available: true, roaming: false] 08-16 15:04:29.967: E/AndroidRuntime(31811): FATAL EXCEPTION: ScionFrontendApi 08-16 15:04:29.967: E/AndroidRuntime(31811): Process: com.XXX.app, PID: 31811 08-16 15:04:29.967: E/AndroidRuntime(31811): java.lang.ExceptionInInitializerError 08-16 15:04:29.967: E/AndroidRuntime(31811): at com.google.android.gms.measurement.internal.C2.(Unknown Source:34) 08-16 15:04:29.967: E/AndroidRuntime(31811): at com.google.android.gms.measurement.internal.S1.(Unknown Source:183) 08-16 15:04:29.967: E/AndroidRuntime(31811): at com.google.android.gms.measurement.internal.S1.G(Unknown Source:58) 08-16 15:04:29.967: E/AndroidRuntime(31811): at com.google.android.gms.measurement.internal.AppMeasurementDynamiteService.initialize(Unknown Source:17) 08-16 15:04:29.967: E/AndroidRuntime(31811): at com.google.android.gms.internal.measurement.o0.a(Unknown Source:108) 08-16 15:04:29.967: E/AndroidRuntime(31811): at com.google.android.gms.internal.measurement.B0.run(Unknown Source:12) 08-16 15:04:29.967: E/AndroidRuntime(31811): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 08-16 15:04:29.967: E/AndroidRuntime(31811): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 08-16 15:04:29.967: E/AndroidRuntime(31811): at java.lang.Thread.run(Thread.java:919) 08-16 15:04:29.967: E/AndroidRuntime(31811): Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodException: E0.h.values [] 08-16 15:04:29.967: E/AndroidRuntime(31811): at java.lang.Enum.enumValues(Enum.java:270) 08-16 15:04:29.967: E/AndroidRuntime(31811): at java.lang.Enum.access$000(Enum.java:61) 08-16 15:04:29.967: E/AndroidRuntime(31811): at java.lang.Enum$1.create(Enum.java:277) 08-16 15:04:29.967: E/AndroidRuntime(31811): at java.lang.Enum$1.create(Enum.java:275) 08-16 15:04:29.967: E/AndroidRuntime(31811): at libcore.util.BasicLruCache.get(BasicLruCache.java:63) 08-16 15:04:29.967: E/AndroidRuntime(31811): at java.lang.Enum.getSharedConstants(Enum.java:289) 08-16 15:04:29.967: E/AndroidRuntime(31811): at java.lang.Class.getEnumConstantsShared(Class.java:2428) 08-16 15:04:29.967: E/AndroidRuntime(31811): at java.util.EnumMap.getKeyUniverse(EnumMap.java:755) 08-16 15:04:29.967: E/AndroidRuntime(31811): at java.util.EnumMap.(EnumMap.java:138) 08-16 15:04:29.967: E/AndroidRuntime(31811): at E0.i.(Unknown Source:7) 08-16 15:04:29.967: E/AndroidRuntime(31811): at E0.i.(Unknown Source:5) 08-16 15:04:29.967: E/AndroidRuntime(31811): ... 9 more 08-16 15:04:29.967: E/AndroidRuntime(31811): Caused by: java.lang.NoSuchMethodException: E0.h.values [] 08-16 15:04:29.967: E/AndroidRuntime(31811): at java.lang.Class.getMethod(Class.java:2072) 08-16 15:04:29.967: E/AndroidRuntime(31811): at java.lang.Class.getDeclaredMethod(Class.java:2050) 08-16 15:04:29.967: E/AndroidRuntime(31811): at java.lang.Enum.enumValues(Enum.java:267) 08-16 15:04:29.967: E/AndroidRuntime(31811): ... 19 more 08-16 15:04:29.974: D/MotionEngine(4127): [@@@ Motion Engine @@@] GetMotionScenarioId 9.725247 -0.167594 -1.575385 0.000000 0.000000 0.000000 8 51 20 08-16 15:04:29.974: D/MotionEngine(4127): [@@@ Motion Engine @@@] GnStuckMode 0 08-16 15:04:29.977: I/System.out(31811): (HTTPLog)-Static: isSBSettingEnabled false 08-16 15:04:30.000: D/ConnectivityService(4127): filterNetworkStateForUid() uid: 10092, pid: 31619 08-16 15:04:30.000: D/ConnectivityService(4127): filterNetworkStateForUid() uid: 10092, pid: 31619, networkInfo: [type: WIFI[], state: CONNECTED/CONNECTED, reason: (unspecified), extra: (none), failover: false, available: true, roaming: false] 08-16 15:04:30.001: D/ConnectivityService(4127): filterNetworkStateForUid() uid: 10092, pid: 31619 08-16 15:04:30.001: D/ConnectivityService(4127): filterNetworkStateForUid() uid: 10092, pid: 31619, networkInfo: [type: WIFI[], state: CONNECTED/CONNECTED, reason: (unspecified), extra: (none), failover: false, available: true, roaming: false] 08-16 15:04:29.977: I/System.out(31811): (HTTPLog)-Static: isSBSettingEnabled false 08-16 15:04:30.022: D/libcrashlytics(31811): Initializing native crash handling successful. ```

Steps to reproduce

Steps to reproduce the behavior:

I have removed every place where Analytics was called and used from my app and only left Firebase Analytics implemented as an observer in main.dart.

like

  void initState() {
    super.initState();
    observer = FirebaseAnalyticsObserver(analytics: FirebaseAnalytics.instance);
  }
    final MaterialApp androidApp = MaterialApp(
      title: _title,
      navigatorKey: NavigationService.navigatorKey,
      debugShowCheckedModeBanner: false,
      navigatorObservers: observer != null ? <NavigatorObserver>[observer!] : <NavigatorObserver>[], <- HERE
      initialRoute: '/',
      routes: Routes.getRoutes(context),
    );

and this is my build.gradle:

    implementation platform('com.google.firebase:firebase-bom:32.0.0')

    implementation 'com.google.firebase:firebase-perf'
    implementation 'com.google.firebase:firebase-crashlytics'
    implementation 'com.google.firebase:firebase-crashlytics-ndk'
    implementation 'com.google.firebase:firebase-config'
    implementation 'com.google.firebase:firebase-messaging'
    implementation 'com.google.firebase:firebase-installations'
    implementation 'com.google.firebase:firebase-analytics'

These are my proguard rules:

#Flutter Wrapper
-keepattributes AutoValue
-keep class io.flutter.app.** { *; }
-keep class io.flutter.plugin.**  { *; }
-keep class io.flutter.util.**  { *; }
-keep class io.flutter.view.**  { *; }
-keep class io.flutter.**  { *; }
-keep class io.flutter.plugins.**  { *; }
-keep class com.google.firebase { *; }
-keep class com.google.firebase.** { *; }

Expected behavior

Expect it not to crash

Additional context

This issue has kind of been described in another one (on emulators too) but since the reporter is missing, it keeps getting "staled" and I'm having some real problems with this situation.

here: https://github.com/firebase/flutterfire/issues/11134


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, 3.13.0, on macOS 13.5 22G74 darwin-arm64, locale pt-BR) [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 14.3.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2022.3) [✓] VS Code (version 1.81.1) [✓] Connected device (2 available) [✓] Network resources • No issues found! ```

Flutter dependencies

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

Click To Expand ``` Dart SDK 3.1.0 Flutter SDK 3.13.0 XXXX dependencies: - android_id 0.3.4 [flutter] - async 2.11.0 [collection meta] - badges 3.1.1 [flutter] - brasil_fields 1.14.0 [flutter intl] - camera 0.10.5+3 [camera_android camera_avfoundation camera_platform_interface camera_web flutter flutter_plugin_android_lifecycle quiver] - cloud_functions 4.4.0 [cloud_functions_platform_interface cloud_functions_web firebase_core firebase_core_platform_interface flutter] - connectivity_plus 4.0.2 [flutter flutter_web_plugins connectivity_plus_platform_interface js meta nm] - cupertino_icons 1.0.5 - currency_text_input_formatter 2.1.10 [flutter intl] - datetime_picker_formfield_new 2.1.0 [flutter intl] - device_info_plus 9.0.3 [device_info_plus_platform_interface ffi file flutter flutter_web_plugins meta win32 win32_registry] - dropdown_plus 0.0.9 [flutter] - file_picker 5.3.3 [flutter flutter_web_plugins flutter_plugin_android_lifecycle plugin_platform_interface ffi path win32] - firebase_analytics 10.4.5 [firebase_analytics_platform_interface firebase_analytics_web firebase_core firebase_core_platform_interface flutter] - firebase_app_installations 0.2.3+5 [firebase_app_installations_platform_interface firebase_app_installations_web firebase_core firebase_core_platform_interface flutter] - firebase_core 2.15.1 [firebase_core_platform_interface firebase_core_web flutter meta] - firebase_crashlytics 3.3.5 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace] - firebase_messaging 14.6.6 [firebase_core firebase_core_platform_interface firebase_messaging_platform_interface firebase_messaging_web flutter meta] - firebase_performance 0.9.2+5 [firebase_core firebase_core_platform_interface firebase_performance_platform_interface firebase_performance_web flutter] - firebase_remote_config 4.2.5 [firebase_core firebase_core_platform_interface firebase_remote_config_platform_interface firebase_remote_config_web flutter] - fl_chart 0.63.0 [equatable flutter] - flutter 0.0.0 [characters collection material_color_utilities meta vector_math web sky_engine] - flutter_animate 4.2.0+1 [flutter] - flutter_app_badger 1.5.0 [flutter] - flutter_credit_card 3.0.7 [flutter] - flutter_local_notifications 9.9.1 [clock flutter flutter_local_notifications_linux flutter_local_notifications_platform_interface timezone] - flutter_localizations 0.0.0 [flutter intl characters clock collection material_color_utilities meta path vector_math web] - flutter_pdfview 1.3.1 [flutter] - flutter_staggered_grid_view 0.7.0 [flutter] - flutter_statusbarcolor_ns 0.5.0 [flutter] - fluttertoast 8.2.2 [flutter flutter_web_plugins] - grouped_list 5.1.2 [flutter] - http 0.13.6 [async http_parser meta] - http_parser 4.0.2 [collection source_span string_scanner typed_data] - intl 0.18.1 [clock meta path] - launch_review 3.0.1 [flutter] - local_auth 2.1.6 [flutter local_auth_android local_auth_ios local_auth_platform_interface local_auth_windows] - open_app_file 4.0.2 [flutter ffi] - package_info_plus 4.1.0 [ffi flutter flutter_web_plugins http meta path package_info_plus_platform_interface win32] - path 1.8.3 - path_provider 2.1.0 [flutter path_provider_android path_provider_foundation path_provider_linux path_provider_platform_interface path_provider_windows] - permission_handler 10.4.3 [flutter meta permission_handler_android permission_handler_apple permission_handler_windows permission_handler_platform_interface] - qr_code_scanner 1.0.1 [js flutter flutter_web_plugins] - share_plus 7.1.0 [cross_file meta mime flutter flutter_web_plugins share_plus_platform_interface file url_launcher_web url_launcher_windows url_launcher_linux url_launcher_platform_interface ffi win32] - shared_preferences 2.2.0 [flutter shared_preferences_android shared_preferences_foundation shared_preferences_linux shared_preferences_platform_interface shared_preferences_web shared_preferences_windows] - url_launcher 6.1.12 [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: - flutter_launcher_icons 0.13.1 [args checked_yaml cli_util image json_annotation path yaml] - flutter_lints 2.0.2 [lints] dependency overrides: - intl 0.18.1 [clock meta path] transitive dependencies: - _flutterfire_internals 1.3.5 [collection firebase_core firebase_core_platform_interface flutter meta] - archive 3.3.7 [crypto path pointycastle] - args 2.4.2 - boolean_selector 2.1.1 [source_span string_scanner] - built_collection 5.1.1 - built_value 8.6.1 [built_collection collection fixnum meta] - camera_android 0.10.8+6 [camera_platform_interface flutter flutter_plugin_android_lifecycle stream_transform] - camera_avfoundation 0.9.13+3 [camera_platform_interface flutter stream_transform] - camera_platform_interface 2.5.1 [cross_file flutter plugin_platform_interface stream_transform] - camera_web 0.3.2+1 [camera_platform_interface flutter flutter_web_plugins stream_transform] - characters 1.3.0 - checked_yaml 2.0.3 [json_annotation source_span yaml] - cli_util 0.4.0 [meta path] - clock 1.1.1 - cloud_functions_platform_interface 5.5.0 [firebase_core flutter meta plugin_platform_interface] - cloud_functions_web 4.6.0 [cloud_functions_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins js] - collection 1.17.2 - connectivity_plus_platform_interface 1.2.4 [flutter meta plugin_platform_interface] - convert 3.1.1 [typed_data] - crclib 3.0.0 [meta tuple] - cross_file 0.3.3+4 [js meta] - crypto 3.0.3 [typed_data] - dbus 0.7.8 [args ffi meta xml] - device_info_plus_platform_interface 7.0.0 [flutter meta plugin_platform_interface] - drift 2.10.0 [async convert collection js meta stream_channel sqlite3 path] - equatable 2.0.5 [collection meta] - fake_async 1.3.1 [clock collection] - ffi 2.1.0 - file 6.1.4 [meta path] - firebase_analytics_platform_interface 3.6.5 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_analytics_web 0.5.4+5 [_flutterfire_internals firebase_analytics_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins js] - firebase_app_installations_platform_interface 0.1.4+5 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_app_installations_web 0.1.3+5 [_flutterfire_internals firebase_app_installations_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins js] - firebase_core_platform_interface 4.8.0 [collection flutter flutter_test meta plugin_platform_interface] - firebase_core_web 2.7.0 [firebase_core_platform_interface flutter flutter_web_plugins js meta] - firebase_crashlytics_platform_interface 3.6.5 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - firebase_messaging_platform_interface 4.5.5 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_messaging_web 3.5.5 [_flutterfire_internals firebase_core firebase_core_web firebase_messaging_platform_interface flutter flutter_web_plugins js meta] - firebase_performance_platform_interface 0.1.4+5 [_flutterfire_internals firebase_core flutter plugin_platform_interface] - firebase_performance_web 0.1.4+5 [_flutterfire_internals firebase_core firebase_core_web firebase_performance_platform_interface flutter flutter_web_plugins js] - firebase_remote_config_platform_interface 1.4.5 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_remote_config_web 1.4.5 [firebase_core firebase_core_web firebase_remote_config_platform_interface flutter flutter_web_plugins js] - fixnum 1.1.0 - 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.15 [flutter] - flutter_test 0.0.0 [flutter test_api matcher path fake_async clock stack_trace vector_math async boolean_selector characters collection material_color_utilities meta source_span stream_channel string_scanner term_glyph web] - flutter_web_plugins 0.0.0 [flutter characters collection material_color_utilities meta vector_math web] - graphs 2.3.1 [collection] - http2 2.2.0 - image 4.0.17 [archive meta xml] - js 0.6.7 [meta] - json_annotation 4.8.1 [meta] - lints 2.1.1 - local_auth_android 1.0.32 [flutter flutter_plugin_android_lifecycle intl local_auth_platform_interface] - local_auth_ios 1.1.3 [flutter intl local_auth_platform_interface] - local_auth_platform_interface 1.0.7 [flutter plugin_platform_interface] - local_auth_windows 1.0.9 [flutter local_auth_platform_interface] - logging 1.2.0 - matcher 0.12.16 [async meta stack_trace term_glyph test_api] - material_color_utilities 0.5.0 [collection] - meta 1.9.1 - mime 1.0.4 - nm 0.5.0 [dbus] - oauth2 2.0.2 [collection crypto http http_parser] - os_detect 2.0.1 - package_info_plus_platform_interface 2.0.1 [flutter meta plugin_platform_interface] - path_provider_android 2.1.0 [flutter path_provider_platform_interface] - path_provider_foundation 2.3.0 [flutter path_provider_platform_interface] - path_provider_linux 2.2.0 [ffi flutter path path_provider_platform_interface xdg_directories] - path_provider_platform_interface 2.1.0 [flutter platform plugin_platform_interface] - path_provider_windows 2.2.0 [ffi flutter path path_provider_platform_interface win32] - permission_handler_android 10.3.3 [flutter permission_handler_platform_interface] - permission_handler_apple 9.1.4 [flutter permission_handler_platform_interface] - permission_handler_platform_interface 3.11.3 [flutter meta plugin_platform_interface] - permission_handler_windows 0.1.3 [flutter permission_handler_platform_interface] - petitparser 5.4.0 [meta] - platform 3.1.1 - plugin_platform_interface 2.1.5 [meta] - pointycastle 3.7.3 [collection convert js] - process 4.2.4 [file path platform] - quiver 3.2.1 [matcher] - retry 3.1.2 - share_plus_platform_interface 3.3.0 [cross_file flutter meta mime plugin_platform_interface path_provider uuid] - shared_preferences_android 2.2.0 [flutter shared_preferences_platform_interface] - shared_preferences_foundation 2.3.3 [flutter shared_preferences_platform_interface] - shared_preferences_linux 2.3.0 [file flutter path path_provider_linux path_provider_platform_interface shared_preferences_platform_interface] - shared_preferences_platform_interface 2.3.0 [flutter plugin_platform_interface] - shared_preferences_web 2.2.0 [flutter flutter_web_plugins shared_preferences_platform_interface] - shared_preferences_windows 2.3.0 [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] - sky_engine 0.0.99 - smithy 0.5.1 [async aws_common built_collection built_value collection convert crypto fixnum http_parser intl json_annotation meta path retry shelf typed_data xml] - smithy_aws 0.5.1 [aws_common aws_signature_v4 built_collection built_value collection convert crclib crypto intl json_annotation meta path smithy xml] - source_span 1.10.0 [collection path term_glyph] - sqlite3 2.1.0 [collection ffi js meta path] - 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.6.0 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph] - timezone 0.8.0 [path] - tuple 2.0.2 - typed_data 1.3.2 [collection] - url_launcher_android 6.0.38 [flutter url_launcher_platform_interface] - url_launcher_ios 6.1.4 [flutter url_launcher_platform_interface] - url_launcher_linux 3.0.5 [flutter url_launcher_platform_interface] - url_launcher_macos 3.0.6 [flutter url_launcher_platform_interface] - url_launcher_platform_interface 2.1.3 [flutter plugin_platform_interface] - url_launcher_web 2.0.18 [flutter flutter_web_plugins url_launcher_platform_interface] - url_launcher_windows 3.0.7 [flutter url_launcher_platform_interface] - uuid 3.0.7 [crypto] - vector_math 2.1.4 - web 0.1.4-beta - win32 5.0.6 [ffi] - win32_registry 1.1.1 [ffi win32] - worker_bee 0.2.0+4 [async aws_common built_collection built_value collection js meta path stack_trace stream_channel stream_transform] - xdg_directories 0.2.0+3 [meta path process] - xml 6.3.0 [collection meta petitparser] - yaml 3.1.2 [collection source_span string_scanner] ```

danagbemava-nc commented 1 year ago

Hi @Fernandomr88, I am curious, is there any particular reason you are using the firebase-bom and other firebase packages directly in your build.gradle when you already have the firebase dependencies in your project?

I imagine there's going to be a conflict in your dependencies because firebase_core already includes the bom.

Which instructions did you use to setup your project?

Fernandomr88 commented 1 year ago

Hi @Fernandomr88, I am curious, is there any particular reason you are using the firebase-bom and other firebase packages directly in your build.gradle when you already have the firebase dependencies in your project?

I imagine there's going to be a conflict in your dependencies because firebase_core already includes the bom.

Which instructions did you use to setup your project?

I followed the same as the previous issue mentions, here https://github.com/firebase/flutterfire/issues/11134#issuecomment-1591426460

Also, When I remove the bom and all firebase implementations from build.gradle the error remains the same.

But I was only able to fix the issue by adding this line to my proguard rules file

-keep class com.google.** { *; }

so now it looks like this:

#Flutter Wrapper
-keepattributes AutoValue
-keep class io.flutter.app.** { *; }
-keep class io.flutter.plugin.**  { *; }
-keep class io.flutter.util.**  { *; }
-keep class io.flutter.view.**  { *; }
-keep class io.flutter.**  { *; }
-keep class io.flutter.plugins.**  { *; }
-keep class com.google.firebase { *; }
-keep class com.google.firebase.** { *; }
-keep class com.google.** { *; }

is that supposed to be done?

Is that related to the usage of that plugin?

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

And if and when I remove the above from build.gradle I have some errors with crashlytics dependencies implementation on build, since I need to configure manually some crashlytics stuff to generate symbols, I have to manually add it.

   buildTypes {
       release {
           signingConfig signingConfigs.release
           firebaseCrashlytics {
              // Enable processing and uploading of native symbols to Firebase servers.
              // By default, this is disabled to improve build speeds.
              // This flag must be enabled to see properly-symbolicated native
              // stack traces in the Crashlytics dashboard.
              nativeSymbolUploadEnabled true
              unstrippedNativeLibsDir file("build/app/intermediates/merged_native_libs/release/out/lib")
           }

Errors mentioned above:

> FAILURE: Build failed with an exception. > > * What went wrong: > A problem was found with the configuration of task ':app:uploadCrashlyticsMappingFileRelease' (type 'UploadMappingFileTask'). > - In plugin 'com.google.firebase.crashlytics' type 'com.google.firebase.crashlytics.buildtools.gradle.tasks.UploadMappingFileTask' property 'googleServicesResourceRoot' doesn't have a configured value. > > Reason: This property isn't marked as optional and no value has been configured. > > Possible solutions: > 1. Assign a value to 'googleServicesResourceRoot'. > 2. Mark property 'googleServicesResourceRoot' as optional. > > Please refer to https://docs.gradle.org/7.5/userguide/validation_problems.html#value_not_set for more details about this problem.
danagbemava-nc commented 1 year ago

The setup for flutter is quite different from the setup for android. You can find the setup instructions here https://firebase.google.com/docs/flutter/setup, for future reference.

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

This plugin is required for google services which since you're using firebase, you will need so you do not need to remove it.

is that supposed to be done?

I don't think this is necessary but since you manually setup the project, I think it may be.

Did you face some issues with the setup for crashlytics here that required that you do the manual setup in your build.gradle?

Fernandomr88 commented 1 year ago

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

This plugin is required for google services which since you're using firebase, you will need so you do not need to remove it.

is that supposed to be done?

I don't think this is necessary but since you manually setup the project, I think it may be.

Did you face some issues with the setup for crashlytics here that required that you do the manual setup in your build.gradle?

check this here:

https://firebase.google.com/docs/crashlytics/get-deobfuscated-reports?platform=flutter#android

where it says:

The flutterfire configure command attempts to add necessary dependencies to your project’s Gradle build files. Without these dependencies, crash reports in the Firebase console may end up obfuscated if obfuscation is turned on.

Make sure the following lines are present in the project-level build.gradle and in the app-level build.gradle:

Fernandomr88 commented 1 year ago

I have just tested without all manual implementations, nothing implemented on build.gradle and also without all proguard rules, failed the same way.

image
danagbemava-nc commented 1 year ago

Labeling this since it has been come up a few times in the past.

shovelmn12 commented 10 months ago

This is caused by minify... happened to me as well

            minifyEnabled false
            shrinkResources false

Solves it

Can we get a better solution?

shovelmn12 commented 10 months ago

@danagbemava-nc are you guys not going to fix it?

Lyokone commented 3 months ago

Has adding the correct Proguard settings fixed the issue? It's not something that we have control over and can change with each R8 release.

google-oss-bot commented 3 months ago

Hey @Fernandomr88. 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!

Fernandomr88 commented 3 months ago

Has adding the correct Proguard settings fixed the issue? It's not something that we have control over and can change with each R8 release.

Yes it does. But that should be on the documentation. Since it's not there this issue might surface again.

Lyokone commented 3 months ago

Thanks for reporting back, I'll close this since it's resolved. We are already working on the documentation.