Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.5.0, on Microsoft Windows [Versión 10.0.19042.1348], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.0-rc2)
[√] Chrome - develop for the web
[√] Android Studio (version 3.6)
[√] VS Code (version 1.52.1)
[√] Connected device (3 available)
My pubsec.yaml has only:
firebase_messaging: ^10.0.1
firebase_core: ^1.2.1
flutter_local_notifications: ^6.1.0
The problem I am having even on a brand new Flutter Project is that I am getting the following error when I add import 'package:firebase_messaging/firebase_messaging.dart'; to main.dart
/D:/Flutter/flutter_windows_2.5.0-stable/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); ^^^^^^^^^^^^^^^^^^^ /D:/Flutter/flutter_windows_2.5.0-stable/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( ^^^^^^^^^^^^^^^^^^^ /D:/Flutter/flutter_windows_2.5.0-stable/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) { ^ FAILURE: Build failed with an exception. * Where: Script 'D:\Flutter\flutter_windows_2.5.0-stable\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1005 * What went wrong: Execution failed for task ':app:compileFlutterBuildDebug'. > Process 'command 'D:\Flutter\flutter_windows_2.5.0-stable\flutter\bin\flutter.bat'' finished with non-zero exit value 1 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 15s Exception: Gradle task assembleDebug failed with exit code 1
firebase_messagingdepends onfirebase_messaging_platform_interfacewhich just got updated to version3.2.0which now depends on Dart 2.16 from Flutter 2.10. Details on issue (also affectedriverpodso very similar). In case upgrading to Flutter 2.10 causes build failures, this may help.