Flutter porcupineManager.delete() when app is closing don't release resources correctly
See original GitHub issueHello,
When I call manually porcupineManager.delete()
before closing app the resources are released correctly, and when I reopen the app I can create and start a new porcupineManager in a correct way.
But when I try to call porcupineManager.delete()
automatically when the StatefulWidget is closed I continue to receive the following message in the debug:
W/FlutterJNI(18227): Tried to send a platform message to Flutter, but FlutterJNI was detached from native C++. Could not send. Channel: flutter_voice_processor_events. Response ID: 0
The problem is that even if I close and restart the app I continue to receive this message and the voice recognition doesn’t work properly.
How can I solve this?
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
porcupine_flutter | Flutter Package - Pub.dev
It enables building always-listening voice-enabled applications using cutting edge voice AI. Porcupine is: private and offline; accurate · resource efficient ( ...
Read more >Flutter cannot delete build folder when flutter clean is executed
Go to Task Manager · search for any Flutter Application running in the Background process, click and End Task · Run flutter clean...
Read more >Picovoice/porcupine: On-device wake word detection ... - GitHub
Once the app is done with using PorcupineManager, you can explicitly release the resources allocated to Porcupine: _porcupineManager.Delete();. There is no ...
Read more >Porcupine Wake Word | Flutter API - Picovoice Docs
Resources should be cleaned when you are done using the delete() function. Use this class when using a custom audio processing pipeline.
Read more >Picovoice - Bountysource
So I have tried to stop the porcupineManager.stop() (To stop from porcupine to listen) then initialized speech recognition and to start listening for...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@maddionatoplus I was also able to reproduce this in our demo as well, however, this behaviour is only ever observed while trying to delete
porcupineManager
from thepaused
state when the back button is pressed on an Android device. If you call delete on back button press from theinactive
state it works fine. If you call delete from thepaused
state in any other situation it works as intended. This seems to be a shortcoming of Flutter and not a bug in our SDK (though we will document this). I would suggest you either call delete when the state entersinactive
or handle the Android back button event separately using the WillPopScope class.Thank you! WillPopScope worked well!