hemanthrajv / flutter_compass

MIT License
98 stars 141 forks source link

Thousands of FlutterJNI errors when app is detached #79

Open badger3512 opened 2 years ago

badger3512 commented 2 years ago

Flutter (Channel stable, 2.8.1, on Ubuntu 20.04.3 LTS 5.4.0-96-generic, locale en_US.UTF-8)

If you run the example app and then detach using the back button, you get 1000's of errors written to logcat:

01-31 11:56:35.544 2946 2946 W FlutterJNI: Tried to send a platform message to Flutter, but FlutterJNI was detached from native C++. Could not send. Channel: hemanthraj/flutter_compass. Response ID: 10213

If you restart the example, then detach again, you get two streams of the error message. A third restart/detach, ditto. It appears that the only way to stop them is to reboot the device.

Is there some way to shutdown the channel, say at app inactive, so this doesn't occur? The error messages don't start until detach.