Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

firebase_messaging [onBackgroundMessage] Attempt to invoke virtual method 'com.google.android.gms.tasks.Task com.google.firebase.iid.FirebaseInstanceId.getInstanceId() #2297

Closed
aliheader opened this issue Apr 3, 2020 · 4 comments
Labels
blocked: customer-response Waiting for customer response, e.g. more information was requested. closed-by-bot plugin: messaging Stale Issue with no recent activity type: bug Something isn't working

Comments

@aliheader
Copy link

aliheader commented Apr 3, 2020

Facing this issue when try to handle the onBackgroundMessage.

Log

D/libGLESv2(15070): STS_GLApi : DTS, ODTC are not allowed for Package : com.example.flutter_firestore_chat

D/ViewRootImpl@f45d8b4[MainActivity](15070): MSG_WINDOW_FOCUS_CHANGED 1

D/ViewRootImpl@f45d8b4[MainActivity](15070): Relayout returned: old=[0,0][1080,1920] new=[0,0][1080,1920] result=0x1 surface={valid=true 2160332800} changed=false

E/MethodChannel#plugins.flutter.io/firebase_messaging(15070): Failed to handle method call

E/MethodChannel#plugins.flutter.io/firebase_messaging(15070): java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.android.gms.tasks.Task com.google.firebase.iid.FirebaseInstanceId.getInstanceId()' on a null object reference

E/MethodChannel#plugins.flutter.io/firebase_messaging(15070):   at io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin.onMethodCall(FirebaseMessagingPlugin.java:237)

E/MethodChannel#plugins.flutter.io/firebase_messaging(15070):   at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:231)

E/MethodChannel#plugins.flutter.io/firebase_messaging(15070):   at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:93)

E/MethodChannel#plugins.flutter.io/firebase_messaging(15070):   at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:642)

E/MethodChannel#plugins.flutter.io/firebase_messaging(15070):   at android.os.MessageQueue.nativePollOnce(Native Method)

E/MethodChannel#plugins.flutter.io/firebase_messaging(15070):   at android.os.MessageQueue.next(MessageQueue.java:325)

E/MethodChannel#plugins.flutter.io/firebase_messaging(15070):   at android.os.Looper.loop(Looper.java:142)

E/MethodChannel#plugins.flutter.io/firebase_messaging(15070):   at android.app.ActivityThread.main(ActivityThread.java:6942)

E/MethodChannel#plugins.flutter.io/firebase_messaging(15070):   at java.lang.reflect.Method.invoke(Native Method)

E/MethodChannel#plugins.flutter.io/firebase_messaging(15070):   at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)

E/MethodChannel#plugins.flutter.io/firebase_messaging(15070):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)

E/MethodChannel#plugins.flutter.io/firebase_messaging(15070): Failed to handle method call

E/MethodChannel#plugins.flutter.io/firebase_messaging(15070): java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.android.gms.tasks.Task com.google.firebase.iid.FirebaseInstanceId.getInstanceId()' on a null object reference

E/MethodChannel#plugins.flutter.io/firebase_messaging(15070):   at io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin.onMethodCall(FirebaseMessagingPlugin.java:185)

E/MethodChannel#plugins.flutter.io/firebase_messaging(15070):   at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:231)

E/MethodChannel#plugins.flutter.io/firebase_messaging(15070):   at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:93)

E/MethodChannel#plugins.flutter.io/firebase_messaging(15070):   at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:642)

E/MethodChannel#plugins.flutter.io/firebase_messaging(15070):   at android.os.MessageQueue.nativePollOnce(Native Method)

E/MethodChannel#plugins.flutter.io/firebase_messaging(15070):   at android.os.MessageQueue.next(MessageQueue.java:325)

E/MethodChannel#plugins.flutter.io/firebase_messaging(15070):   at android.os.Looper.loop(Looper.java:142)

E/MethodChannel#plugins.flutter.io/firebase_messaging(15070):   at android.app.ActivityThread.main(ActivityThread.java:6942)

E/MethodChannel#plugins.flutter.io/firebase_messaging(15070):   at java.lang.reflect.Method.invoke(Native Method)

E/MethodChannel#plugins.flutter.io/firebase_messaging(15070):   at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)

E/MethodChannel#plugins.flutter.io/firebase_messaging(15070):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)

E/MethodChannel#plugins.flutter.io/firebase_messaging(15070): Failed to handle method call

E/MethodChannel#plugins.flutter.io/firebase_messaging(15070): java.lang.RuntimeException: PluginRegistrantCallback is not
set.

E/MethodChannel#plugins.flutter.io/firebase_messaging(15070):   at io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService.startBackgroundIsolate(FlutterFirebaseMessagingService.java:157)

E/MethodChannel#plugins.flutter.io/firebase_messaging(15070):   at io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin.onMethodCall(FirebaseMessagingPlugin.java:176)

E/MethodChannel#plugins.flutter.io/firebase_messaging(15070):   at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:231)

E/MethodChannel#plugins.flutter.io/firebase_messaging(15070):   at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:93)

E/MethodChannel#plugins.flutter.io/firebase_messaging(15070):   at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:642)

E/MethodChannel#plugins.flutter.io/firebase_messaging(15070):   at android.os.MessageQueue.nativePollOnce(Native Method)

E/MethodChannel#plugins.flutter.io/firebase_messaging(15070):   at android.os.MessageQueue.next(MessageQueue.java:325)

E/MethodChannel#plugins.flutter.io/firebase_messaging(15070):   at android.os.Looper.loop(Looper.java:142)

E/MethodChannel#plugins.flutter.io/firebase_messaging(15070):   at android.app.ActivityThread.main(ActivityThread.java:6942)

E/MethodChannel#plugins.flutter.io/firebase_messaging(15070):   at java.lang.reflect.Method.invoke(Native Method)

E/MethodChannel#plugins.flutter.io/firebase_messaging(15070):   at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)

E/MethodChannel#plugins.flutter.io/firebase_messaging(15070):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)

I/flutter (15070): Error Token PlatformException(error, Attempt to invoke virtual method 'com.google.android.gms.tasks.Task com.google.firebase.iid.FirebaseInstanceId.getInstanceId()' on a null object reference, null)

E/flutter (15070): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: PlatformException(error, Attempt to invoke virtual method 'com.google.android.gms.tasks.Task com.google.firebase.iid.FirebaseInstanceId.getInstanceId()' on a null object reference, null)

E/flutter (15070): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7)

E/flutter (15070): #1      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:321:33)

E/flutter (15070): <asynchronous suspension>

E/flutter (15070): #2      FirebaseMessaging.configure (package:firebase_messaging/firebase_messaging.dart:114:14)

E/flutter (15070): #3      _AuthScreenState.initiallizeFirebase (package:flutter_firestore_chat/main.dart:78:24)

E/flutter (15070): #4      _AsyncAwaitCompleter.start (dart:async-patch/async_patch.dart:45:6)

E/flutter (15070): #5      _AuthScreenState.initiallizeFirebase (package:flutter_firestore_chat/main.dart:69:22)

E/flutter (15070): #6      _AuthScreenState.initState (package:flutter_firestore_chat/main.dart:65:5)

E/flutter (15070): #7      StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4355:58)

E/flutter (15070): #8      ComponentElement.mount (package:flutter/src/widgets/framework.dart:4201:5)

E/flutter (15070): #9      Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)

E/flutter (15070): #10     Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)

E/flutter (15070): #11     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5445:14)

E/flutter (15070): #12     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)

E/flutter (15070): #13     Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)

E/flutter (15070): #14     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4243:16)

E/flutter (15070): #15     Element.rebuild (package:flutter/src/widgets/framework.dart:3947:5)

E/flutter (15070): #16     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4206:5)

E/flutter (15070): #17     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4201:5)

E/flutter (15070): #18     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)

E/flutter (15070): #19     Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)

E/flutter (15070): #20     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5445:14)

E/flutter (15070): #21     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)

E/flutter (15070): #22     Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)

E/flutter (15070): #23     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5445:14)

E/flutter (15070): #24     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)

E/flutter (15070): #25     Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)

E/flutter (15070): #26     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4243:16)

E/flutter (15070): #27     Element.rebuild (package:flutter/src/widgets/framework.dart:3947:5)

E/flutter (15070): #28     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4206:5)

E/flutter (15070): #29     StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4381:11)

E/flutter (15070): #30     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4201:5)

E/flutter (15070): #31     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)

E/flutter (15070): #32     Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)

E/flutter (15070): #33     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5445:14)

E/flutter (15070): #34     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)

E/flutter (15070): #35     Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)

E/flutter (15070): #36     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5445:14)

E/flutter (15070): #37     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)

E/flutter (15070): #38     Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)

E/flutter (15070): #39     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4243:16)

E/flutter (15070): #40     Element.rebuild (package:flutter/src/widgets/framework.dart:3947:5)

E/flutter (15070): #41     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4206:5)

E/flutter (15070): #42     StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4381:11)

E/flutter (15070): #43     ComponentElement.mount (package:flutter/s

E/flutter (15070): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: PlatformException(error, PluginRegistrantCallback is not set., null)

E/flutter (15070): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7)

E/flutter (15070): #1      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:321:33)

E/flutter (15070): <asynchronous suspension>

E/flutter (15070): #2      FirebaseMessaging.configure (package:firebase_messaging/firebase_messaging.dart:130:16)

E/flutter (15070): #3      _AuthScreenState.initiallizeFirebase (package:flutter_firestore_chat/main.dart:78:24)

E/flutter (15070): #4      _AsyncAwaitCompleter.start (dart:async-patch/async_patch.dart:45:6)

E/flutter (15070): #5      _AuthScreenState.initiallizeFirebase (package:flutter_firestore_chat/main.dart:69:22)

E/flutter (15070): #6      _AuthScreenState.initState (package:flutter_firestore_chat/main.dart:65:5)

E/flutter (15070): #7      StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4355:58)

E/flutter (15070): #8      ComponentElement.mount (package:flutter/src/widgets/framework.dart:4201:5)

E/flutter (15070): #9      Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)

E/flutter (15070): #10     Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)

E/flutter (15070): #11     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5445:14)

E/flutter (15070): #12     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)

E/flutter (15070): #13     Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)

E/flutter (15070): #14     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4243:16)

E/flutter (15070): #15     Element.rebuild (package:flutter/src/widgets/framework.dart:3947:5)

E/flutter (15070): #16     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4206:5)

E/flutter (15070): #17     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4201:5)

E/flutter (15070): #18     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)

E/flutter (15070): #19     Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)

E/flutter (15070): #20     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5445:14)

E/flutter (15070): #21     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)

E/flutter (15070): #22     Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)

E/flutter (15070): #23     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5445:14)

E/flutter (15070): #24     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)

E/flutter (15070): #25     Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)

E/flutter (15070): #26     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4243:16)

E/flutter (15070): #27     Element.rebuild (package:flutter/src/widgets/framework.dart:3947:5)

E/flutter (15070): #28     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4206:5)

E/flutter (15070): #29     StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4381:11)

E/flutter (15070): #30     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4201:5)

E/flutter (15070): #31     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)

E/flutter (15070): #32     Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)

E/flutter (15070): #33     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5445:14)

E/flutter (15070): #34     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)

E/flutter (15070): #35     Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)

E/flutter (15070): #36     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5445:14)

E/flutter (15070): #37     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)

E/flutter (15070): #38     Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)

E/flutter (15070): #39     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4243:16)

E/flutter (15070): #40     Element.rebuild (package:flutter/src/widgets/framework.dart:3947:5)

E/flutter (15070): #41     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4206:5)

E/flutter (15070): #42     StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4381:11)

E/flutter (15070): #43     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4201:5)

E/flutter (15070): #44     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)

E/flutter (15070): #2155 
@aliheader aliheader added the type: bug Something isn't working label Apr 3, 2020
@iapicca
Copy link

iapicca commented Apr 9, 2020

Hi @ali7234
can you please provide your flutter doctor -v ,
your full flutter run --verbose (if it's too long you may attach it as txt file)
and your pubspec.yaml
or if possible a reproducible minimal code sample.
Thank you

@iapicca iapicca added the blocked: customer-response Waiting for customer response, e.g. more information was requested. label Apr 9, 2020
@Ehesp
Copy link
Member

Ehesp commented Apr 21, 2020

Which version on the plugin and Flutter are you using?

@google-oss-bot google-oss-bot added the Stale Issue with no recent activity label Jul 30, 2020
@google-oss-bot
Copy link

Hey @ali7234. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

@google-oss-bot
Copy link

Since there haven't been any recent updates here, I am going to close this issue.

@ali7234 if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

@firebase firebase locked and limited conversation to collaborators Sep 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
blocked: customer-response Waiting for customer response, e.g. more information was requested. closed-by-bot plugin: messaging Stale Issue with no recent activity type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants