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
[Bug] NullPointerException when accessing contacts via a Dart Isolate (Background | Android) #232
Comments
I will look into this issue over the weekend. Thanks! |
Hey, this was solved when we switched from the old FlutterNativeView to using FlutterEngine to start the isolate. I don't believe this is an issue anymore for us. Thanks for replying so I remembered to close it! |
Same issue inside Isolate.spawn(). issue :
|
Hi |
Hopefully this is helpful, but this is how we use FlutterEngine in our project: https://github.com/BlueBubblesApp/bluebubbles-app/blob/b7ad394233376c29a5081b6e136d90bd7303c17b/android/app/src/main/java/com/bluebubbles/messaging/workers/FCMWorker.java#L108-L109 |
Thanks for your answer. |
could you please he,p on what you mean running await? do I add this to the flutter code or the dependency |
Here is an updated link to how we use the engine, with our latest code base. I dont think much has changed, but maybe it'll help: https://github.com/BlueBubblesApp/bluebubbles-app/blob/5ae9a183734bf3de2107a95b3799429c49a85186/android/app/src/main/java/com/bluebubbles/messaging/workers/FCMWorker.java#L106-L112 |
Hey all, I'm in the process of migration from Flutter v1 to v2, and one of the things that seems like it broke is my Dart Background Isolate that handles Google FCM notifications. When a notification is received, the isolate gets spun up and the notification is handled, i.e., contacts get fetched, avatars get loaded, etc.
The issue I'm running into is when I fetch contacts from the isolate (even if permissions are granted), I get this error. This error does not occur when the app is open, only when the app is closed and the contacts service is used within the isolate.
There is a similar ticket to this, but it was for iOS. My issue is with Android: #200
Here is the error
Here is a log showing some prints for when we fetch the contacts from the isolate, and showing that permissions are granted, the the error:
Here is my flutter doctor:
The text was updated successfully, but these errors were encountered: