Is there an existing issue for this?
Which plugins are affected?
Messaging
Which platforms are affected?
Android
Description
firebase_messaging 16.4.2 does not compile. FirebaseMessaging extends a base class named FirebasePlugin, but no published firebase_core_platform_interface defines that type. Any resolve that lands on 16.4.2 fails at build time:
firebase_messaging-16.4.2/lib/src/messaging.dart:11:33: Error: Type 'FirebasePlugin' not found.
class FirebaseMessaging extends FirebasePlugin {
^^^^^^^^^^^^^^
firebase_messaging-16.4.2/lib/src/messaging.dart:21:36: Error: The getter 'pluginConstants' isn't defined for the type 'FirebaseMessaging'.
app: app, pluginConstants: pluginConstants);
^^^^^^^^^^^^^^^
Target kernel_snapshot_program failed: Exception
What changed between 16.4.1 and 16.4.2:
16.4.1: class FirebaseMessaging extends FirebasePluginPlatform // compiles
16.4.2: class FirebaseMessaging extends FirebasePlugin // does not compile
firebase_messaging.dart pulls FirebasePlugin via show FirebasePlugin from firebase_core_platform_interface, but:
firebase_core_platform_interface latest is 7.1.0, and it defines only FirebasePluginPlatform (extends PlatformInterface). No published version defines FirebasePlugin.
firebase_core 4.12.0, which is 16.4.2's declared minimum, exports no Dart FirebasePlugin either.
- 16.4.2 constrains
firebase_core_platform_interface: ^7.1.0, which resolves to 7.1.0 and lacks the symbol.
It looks like the FirebasePluginPlatform to FirebasePlugin rename shipped in the 16.4.2 publish, but the matching firebase_core_platform_interface release that actually defines FirebasePlugin was never published, or the constraint was not bumped to require it. 16.4.1 still extends FirebasePluginPlatform and compiles fine.
Reproducing the issue
- Use any pubspec whose version range admits firebase_messaging 16.4.2.
- Run
flutter pub get. It resolves firebase_messaging 16.4.2, firebase_core 4.12.0, firebase_core_platform_interface 7.1.0.
- Run
flutter build for any target. Compilation fails with the errors above.
Workaround: pin firebase_messaging: 16.4.1.
Firebase Core version
4.12.0
Flutter Version
3.44.5 (stable), Dart 3.12.2
Relevant Log Output
firebase_messaging-16.4.2/lib/src/messaging.dart:11:33: Error: Type 'FirebasePlugin' not found.
class FirebaseMessaging extends FirebasePlugin {
^^^^^^^^^^^^^^
firebase_messaging-16.4.2/lib/src/messaging.dart:21:36: Error: The getter 'pluginConstants' isn't defined for the type 'FirebaseMessaging'.
- 'FirebaseMessaging' is from 'package:firebase_messaging/firebase_messaging.dart'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'pluginConstants'.
app: app, pluginConstants: pluginConstants);
^^^^^^^^^^^^^^^
Target kernel_snapshot_program failed: Exception
Flutter dependencies
Expand Flutter dependencies snippet
firebase_core 4.12.0
firebase_core_platform_interface 7.1.0
firebase_core_web 3.9.0
firebase_messaging 16.4.2
firebase_messaging_platform_interface 4.9.1
firebase_messaging_web 4.2.2
Additional context and comments
No response
Is there an existing issue for this?
Which plugins are affected?
Messaging
Which platforms are affected?
Android
Description
firebase_messaging 16.4.2 does not compile.
FirebaseMessagingextends a base class namedFirebasePlugin, but no publishedfirebase_core_platform_interfacedefines that type. Any resolve that lands on 16.4.2 fails at build time:What changed between 16.4.1 and 16.4.2:
firebase_messaging.dartpullsFirebasePluginviashow FirebasePluginfromfirebase_core_platform_interface, but:firebase_core_platform_interfacelatest is 7.1.0, and it defines onlyFirebasePluginPlatform(extendsPlatformInterface). No published version definesFirebasePlugin.firebase_core4.12.0, which is 16.4.2's declared minimum, exports no DartFirebasePlugineither.firebase_core_platform_interface: ^7.1.0, which resolves to 7.1.0 and lacks the symbol.It looks like the
FirebasePluginPlatformtoFirebasePluginrename shipped in the 16.4.2 publish, but the matchingfirebase_core_platform_interfacerelease that actually definesFirebasePluginwas never published, or the constraint was not bumped to require it. 16.4.1 still extendsFirebasePluginPlatformand compiles fine.Reproducing the issue
flutter pub get. It resolves firebase_messaging 16.4.2, firebase_core 4.12.0, firebase_core_platform_interface 7.1.0.flutter buildfor any target. Compilation fails with the errors above.Workaround: pin
firebase_messaging: 16.4.1.Firebase Core version
4.12.0
Flutter Version
3.44.5 (stable), Dart 3.12.2
Relevant Log Output
Flutter dependencies
Expand
Flutter dependenciessnippetAdditional context and comments
No response