Home > OS >  Flutter app running on web failing with error:
Flutter app running on web failing with error:

Time:02-25

**/C:/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging_web-2.2.8/lib/src/internals.dart:11:10: Error: Method not found: 'guardWebExceptions'. return internals.guardWebExceptions( ^^^^^^^^^^^^^^^^^^

/C:/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging_platform_interface-3.2.0/lib/src/method_channel/utils/exception.dart:13:11:

Error: Method not found: 'Error.throwWithStackTrace'. Error.throwWithStackTrace(exception, stackTrace); ^^^^^^^^^^^^^^^^^^^

/C:/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging_platform_interface-3.2.0/lib/src/method_channel/utils/exception.dart:16:9:

Error: Method not found: 'Error.throwWithStackTrace'.
Error.throwWithStackTrace( ^^^^^^^^^^^^^^^^^^^

/C:/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging_platform_interface-3.2.0/lib/src/method_channel/utils/exception.dart:11:7:

Error: A non-null value must be returned since the return type 'Never' doesn't allow null. Never convertPlatformException(Object exception, StackTrace stackTrace) { ^ Failed to compile application.**

CodePudding user response:

I found a solution for this.

I added it to my pubspeck.yaml:

dependency_overrides:
  firebase_messaging_platform_interface: 3.1.6

Have a good day :)

CodePudding user response:

I have faced the same problem and got a workaround for this.

override firebase_messaging_platform_interface in pubspeck.yaml:

dependency_overrides:
  firebase_messaging_platform_interface: 3.1.6

check ref: https://github.com/FirebaseExtended/flutterfire/issues/8181

CodePudding user response:

Tried all of the proposals, here and in the link here: https://github.com/FirebaseExtended/flutterfire/issues/8181

But only that worked for me

dependency_overrides:
  firebase_messaging_platform_interface: 3.1.6
  firebase_crashlytics_platform_interface: 3.1.13
  cloud_firestore_platform_interface: 5.4.13
  firebase_auth_platform_interface: 6.1.11
  firebase_storage_platform_interface: 4.0.14
  cloud_functions_platform_interface: 5.0.21
  firebase_analytics_platform_interface: 3.0.5
  firebase_remote_config_platform_interface: 1.0.5
  firebase_dynamic_links_platform_interface: 0.2.0 5
  firebase_performance_platform_interface: 0.1.0 5
  firebase_app_installations_platform_interface: 0.1.0 6

This are the dependencies I am using in first place

  firebase_core: ^1.6.0
  firebase_crashlytics: ^2.2.1
  firebase_messaging: ^10.0.9
  firebase_analytics: ^9.1.0
  • Related