alphacep / vosk-flutter

Apache License 2.0
50 stars 30 forks source link

[Error] No implementation found for method model.create #23

Closed andyyapwl closed 6 months ago

andyyapwl commented 6 months ago

hi, i got the below error when running the below code:

Model model = await _vosk.createModel(enSmallModelPath);

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method model.create on channel vosk_flutter) E/flutter (23007): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:332:7)

Is there anything i have missed out? Thanks

nshmyrev commented 6 months ago

On what platform do you run it

andyyapwl commented 6 months ago

Apologies for the oversight; I forgot to mention the platform. Currently, I'm running the application on my Android mobile device.

I realized that I hadn't included the Vosk Android implementation code in my project. Initially, I attempted to use the vosk-flutter package, but it uses a different version of the http package compared to my Flutter project. To resolve this, I cloned the vosk-flutter package and manually removed the http package dependency, along with the related code. Subsequently, I integrated the modified flutter_vosk package into my Flutter project, inadvertently missing the inclusion of the Android implementation code.

I appreciate your swift response; it prompted me to reevaluate this issue.

Thank you!

andyyapwl commented 6 months ago

Just realized I can actually define dependency_overrides at the pubspec.yaml: dependency_overrides: http: ^1.0.0

Then there is no need to clone and reference local copy since it is now compatible with my flutter project.

Thanks for the great library:)