mo-ah-dawood / fcm_config

10 stars 12 forks source link

Outdated FlutterFirebaseMessagingPlugin.java #4

Closed meghead closed 3 years ago

meghead commented 3 years ago

Since I upgraded to the Null Safety environment sdk: ">=2.12.0 <3.0.0" in pubspec.yaml I started getting the following errors in Android Studio when I try to build my app;

C:\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_messaging-9.1.4\android\src\main\java\io\flutter\plugins\firebase\messaging\FlutterFirebaseMessagingPlugin.java:20: error: cannot find symbol
import com.google.firebase.iid.FirebaseInstanceId;
                              ^
  symbol:   class FirebaseInstanceId
  location: package com.google.firebase.iid
C:\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_messaging-9.1.4\android\src\main\java\io\flutter\plugins\firebase\messaging\FlutterFirebaseMessagingPlugin.java:21: error: cannot find symbol
import com.google.firebase.iid.Metadata;
                              ^
  symbol:   class Metadata
  location: package com.google.firebase.iid
C:\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_messaging-9.1.4\android\src\main\java\io\flutter\plugins\firebase\messaging\FlutterFirebaseMessagingPlugin.java:152: error: cannot find symbol
                  : Metadata.getDefaultSenderId(FirebaseApp.getInstance());
                    ^
  symbol:   variable Metadata
  location: class FlutterFirebaseMessagingPlugin
C:\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_messaging-9.1.4\android\src\main\java\io\flutter\plugins\firebase\messaging\FlutterFirebaseMessagingPlugin.java:153: error: cannot find symbol
          FirebaseInstanceId.getInstance().deleteToken(senderId, "*");
          ^
  symbol:   variable FirebaseInstanceId
  location: class FlutterFirebaseMessagingPlugin
C:\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_messaging-9.1.4\android\src\main\java\io\flutter\plugins\firebase\messaging\FlutterFirebaseMessagingPlugin.java:165: error: cannot find symbol
                  : Metadata.getDefaultSenderId(FirebaseApp.getInstance());
                    ^
  symbol:   variable Metadata
  location: class FlutterFirebaseMessagingPlugin
C:\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_messaging-9.1.4\android\src\main\java\io\flutter\plugins\firebase\messaging\FlutterFirebaseMessagingPlugin.java:166: error: cannot find symbol
          String token = FirebaseInstanceId.getInstance().getToken(senderId, "*");
                         ^
  symbol:   variable FirebaseInstanceId
  location: class FlutterFirebaseMessagingPlugin
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
6 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':firebase_messaging:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
mo-ah-dawood commented 3 years ago

i updated firbase_messaging to latest version so please try again

mo-ah-dawood commented 3 years ago

3.0.5

meghead commented 3 years ago

I can confirm that the correct Firebase Messaging plugins are now being downloaded.