icapps / flutter-background-location-tracker

Flutter background location tracker plugin. (Android / iOS)
MIT License
31 stars 37 forks source link

shared_preferences doesn't work - "Tried to send a platform message response, but FlutterJNI was detached from native C++. Could not send. Response ID: 6" #47

Closed dJani97 closed 1 year ago

dJani97 commented 1 year ago

Since internet access isn't guaranteed when running in the background, I wanted to rely on shared_preferences.

So I tried to run the example project, which happens to use shared_preferences, and it works properly.

But for some reason, when I import it into my project and try to write into shared preferences, I get the following error:

Tried to send a platform message response, but FlutterJNI was detached from native C++. Could not send. Response ID: 6

Does anyone have a clue why?

My setup:

Flutter 3.7
Dart 2.19.0
background_location_tracker: ^1.4.0
shared_preferences: ^2.0.17
dJani97 commented 1 year ago

They still don't work, but probably for another reason - I'm closing this for now.