-
Notifications
You must be signed in to change notification settings - Fork 45
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
Unhandled Exception: PlatformException(INITIALIZE_FAIL, SpeechService instance already exist., null, null) #20
Comments
Hi! Please attach the code you are running. |
this error happens on the package code example, I think it's related to not disposing the service and the recognizer, but I even tried to dispose them in the dispose() method and the error still happens. (on hot restart because that's when the initService is called (inside initState())) |
For sake of time, I modified the existing class and added speechService and getter for my screen to access: class VoskFlutterPlugin { Future<SpeechService?> initSpeechService(Recognizer recognizer) async {
} SpeechService? getSpeechService() { My project code: |
Thanks for your solution @andyyapwl , it worked fine. |
When using the library in flutter everything works fine, but when I do a hot restart, suddenly this error occurs. I initialize the speech service using vosk.initSpeechService() in a separate method that I run in initState().
The text was updated successfully, but these errors were encountered: