[SOLVED] FlutterFirebaseMessagingPlugin.java – Build fails with Exception “error: cannot find symbol”

Problem

After upgrading firebase_auth to latest version (i.e., ^1.2.0), it says update intl to ^0.17.0. When i updated intl, I’m getting errors when I try to run flutter pub get.

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

Solution

Update firebase_messaging to latest one (Currently i.e., firebase_messaging: ^10.0.0), and call flutter pub get.

That’s it.

Thanks for Reading.

Keep Coding.

Tagged : / / / /

302 Found: What It Is and How to Fix It?

What is 302 status?

The HTTP response status code 302 Found is a common way of performing URL redirection. A 302 Found message is an HTTP response status code indicating that the requested resource has been temporarily moved to a different URI. All HTTP response status codes that are in the 3xx category are considered redirection messages.

Diagnosing a 302 Found Response Code

it’s entirely possible that the server is misconfigured, causing it to improperly respond with 302 Found codes, instead of the standard and expected 200 OK code of a normal, functional request.

If your application is responding with 302 Found codes, this is an issue that many other visitors may be experiencing as well, dramatically hindering your application’s ability to service users.

if you want to dig out on above topic then follow below references :

By ClickMinded

so friends here I am describing all above things for understanding about 302. because i am facing this issue in my Laravel application so let’s check out to solve these issues in your Laravel application. below is the attached urls for common issue in Laravel related to 302.

References :

  1. Click Here
  2. Click Here
  3. Click Here
Tagged : / / / / / /