question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Flutter porcupineManager.delete() when app is closing don't release resources correctly

See original GitHub issue

Hello, 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:closed
  • Created 2 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
lavescommented, Apr 30, 2021

@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 the paused state when the back button is pressed on an Android device. If you call delete on back button press from the inactive state it works fine. If you call delete from the paused 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 enters inactive or handle the Android back button event separately using the WillPopScope class.

0reactions
maddionatopluscommented, May 4, 2021

Thank you! WillPopScope worked well!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found