flutter_tts icon indicating copy to clipboard operation
flutter_tts copied to clipboard

Example code not loading engines or languages on emulator

Open jlanoieuri opened this issue 2 years ago • 12 comments

💬 Questions and Help

I'm having trouble getting TTS to work on my codebase when using an emulator that is running Android 11 (tested on multiple emulators). For testing I copied the example code into my codebase and it is stuck on "Loading engines..." and "Loading Languages..." This same code works fine on Android 10 on the emulator, and it also works on Android 11 on physical devices, just not emulated Android 11 devices.

Configuration:

  • In android/app/build.gradle I have the minimum Android SDK version set to 21 as instructed in the README.
  • Dart SDK constraints: ">=2.6.0 <3.0.0"
  • flutter_tts version: 3.2.1

I have tried with and without the following included in the manifest file and it made no difference:

<manifest ... >
...
   <queries>
       <intent>
           <action android:name="TextToSpeech.Engine.INTENT_ACTION_TTS_SERVICE" />
       </intent>
   </queries>
...
</manifest>

I'm not sure that I am including this correctly though.

jlanoieuri avatar Jul 14 '21 23:07 jlanoieuri

@jlanoieuri have you tried with new API versions? Although API level 21 is the min supported, it's very limited.

dlutton avatar Jul 25 '21 02:07 dlutton

I am facing the same issue. It works with android 10 emulator, API 29; doesn't work with android 11 emulator, API 30. It works on physical device though.

sandeshgoel avatar Jul 29 '21 06:07 sandeshgoel

@sandeshgoel have you tried the latest 3.2.2 version for working with android 11? You may need to run a flutter clean before building.

dlutton avatar Jul 29 '21 20:07 dlutton

@sandeshgoel have you tried the latest 3.2.2 version for working with android 11? You may need to run a flutter clean before building.

I use the latest sample code, running on a Lenovo Tab-X616F device, Android version 10, unable to speak. The sample code has been loading engines...

ebc004bb-667d-4d23-86cb-28c76108b7d9

Rob-wang avatar Nov 04 '21 07:11 Rob-wang

@Rob-wang do you see any error messages that could be helpful in troubleshooting your issue?

dlutton avatar Nov 07 '21 23:11 dlutton

@Rob-wang do you see any error messages that could be helpful in troubleshooting your issue?

NO, No error displayed

Rob-wang avatar Nov 08 '21 02:11 Rob-wang

@Rob-wang what version of flutter are you on?

dlutton avatar Nov 09 '21 00:11 dlutton

@Rob-wang what version of flutter are you on?

macOS Big Sur 11.5.2 Flutter 2.5.1 • channel stable • Tools • Dart 2.14.2

Rob-wang avatar Nov 09 '21 02:11 Rob-wang

我应该也是这个问题,getEngines只获得了com.samsung.SMT

mimiaopp avatar Nov 09 '21 08:11 mimiaopp

@Rob-wang okay I don't have that device, but I'll try to replicate the issue.

dlutton avatar Nov 10 '21 17:11 dlutton

@Rob-wang okay I don't have that device, but I'll try to replicate the issue.

thanks. If it is repaired, can you reply to me? Looking forward to your good news

Rob-wang avatar Nov 12 '21 02:11 Rob-wang

Is there any solution ? I got same error when i tried at android emulator .

API : 30 Android API 11.0 Device : Pixel 4 XL @dlutton @Rob-wang

turgayh avatar Aug 07 '22 20:08 turgayh