flutter_tts icon indicating copy to clipboard operation
flutter_tts copied to clipboard

Unhandled Exception: MissingPluginException(No implementation found for method setEngine on channel flutter_tts)

Open minh-dai opened this issue 1 year ago • 3 comments

🐛 Bug Report

I just run the example project on my iPhone

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method setEngine on channel flutter_tts) #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:332:7) #1 FlutterTts.setEngine (package:flutter_tts/flutter_tts.dart:454:5) #2 TTSModule.changedEnginesDropDownItem (package:tts/tts.dart:333:5)

Version: flutter 3.19.6

Platform:

  • [ ] :iphone: iOS 17.4.1
  • [ ] :robot: Android

minh-dai avatar May 20 '24 15:05 minh-dai

There is no engine selection in IOS, that's why you have this exception, it is kind of expected.

echogit avatar Jun 29 '24 02:06 echogit

same issue here, what is solution for iOS then?

DevanshiGor avatar Aug 13 '24 09:08 DevanshiGor

same issue here, what is solution for iOS then?

As I said above, you need to check if you are on iOS and to not call this method.

Such as:

import 'dart:io' 
...
if (Platform.isAndroid) 
{ 
      // Android-specific code, such as using setEngine 
} 
else if (Platform.isIOS) { 
     // iOS-specific code 
}

echogit avatar Aug 31 '24 21:08 echogit