Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

flutter_tts does not speak, or stops early, on Android or iOS

Errorflutter_tts speak() returns but no sound is heard

Short answer

Check platform setup first. On Android 11 and newer the manifest needs a queries entry for the TTS service, and minSdk must be 21 or higher. On iOS set the shared instance and an audio category. Then check that the language is available and await completion.

  • Applies to Flutter 3.35, Android 14, iOS 17
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Ask the plugin what it can see: engines (Android) and whether your language is available. An empty list or false tells you which cause applies.

    final tts = FlutterTts();
    print(await tts.getEngines);                    // Android only
    print(await tts.isLanguageAvailable("en-US"));
  2. 2Match what you see, then jump to its fix

    1. 1getEngines is empty or speak does nothing on Android 11 and newerAndroid 11+ package visibility hides the TTS serviceFix
    2. 2The app targets a minSdk below 21, or an older Kotlin plugin than the README namesAndroid minSdk or Kotlin plugin version is below the plugin's requirementFix
    3. 3Works on Android, silent on iOS, or it stops other audio in the appiOS audio session blocks or mutes the speechFix
    4. 4The first sentence is cut off by the nextSpeak is called again before the previous one finishedFix
    5. 5isLanguageAvailable returns falseThe language is not installed on the deviceFix

What does the error look like?

  • flutter_tts speak() returns but no sound is heard
  • Text to speech works on one phone but not on another
  • Speech starts and then the next speak() call cuts it off

Cause 1 of 5

Android 11+ package visibility hides the TTS service

1Check

The plugin needs to see the TextToSpeech service. Look for a queries block in the app manifest.

grep -n -A4 "<queries>" android/app/src/main/AndroidManifest.xml

2Fix

Add a queries element with the TTS service intent, outside the application tag.

<queries>
  <intent>
    <action android:name="android.intent.action.TTS_SERVICE" />
  </intent>
</queries>

3Verify

Rebuild (a hot restart does not re-read the manifest) and print getEngines again.

flutter run

Confirmed by pub.dev

Did this fix it?

Cause 2 of 5

Android minSdk or Kotlin plugin version is below the plugin's requirement

1Check

The plugin README asks for minSdkVersion 21 or higher and Kotlin Gradle plugin 1.9.10.

grep -rn -E "minSdk|org.jetbrains.kotlin.android" android/

2Fix

Raise minSdk to 21 or higher, and the Kotlin plugin to the version the README names.

// android/app/build.gradle (or build.gradle.kts)
defaultConfig {
    minSdk = 21
}

3Verify

Build the app.

flutter build apk --debug

Confirmed by pub.dev

Did this fix it?

Cause 3 of 5

iOS audio session blocks or mutes the speech

1Check

The README shows iOS-only calls: setSharedInstance and setIosAudioCategory.

grep -rn "setIosAudioCategory\|setSharedInstance" lib/

2Fix

Set the shared instance and an audio category before speaking.

await tts.setSharedInstance(true);
await tts.setIosAudioCategory(
  IosTextToSpeechAudioCategory.ambient,
  [
    IosTextToSpeechAudioCategoryOptions.allowBluetooth,
    IosTextToSpeechAudioCategoryOptions.mixWithOthers,
  ],
  IosTextToSpeechAudioMode.voicePrompt,
);

3Verify

Run on a real iPhone and speak a short phrase.

flutter run -d <your-iphone-id>

Confirmed by pub.dev

Did this fix it?

Cause 4 of 5

Speak is called again before the previous one finished

1Check

speak returns before audio ends unless you ask the plugin to wait.

grep -rn "awaitSpeakCompletion" lib/

2Fix

Enable completion waiting once, then await each speak.

await tts.awaitSpeakCompletion(true);
await tts.speak("First sentence.");
await tts.speak("Second sentence.");

3Verify

Both sentences should play in order.

flutter run

Confirmed by pub.dev

Did this fix it?

Cause 5 of 5

The language is not installed on the device

1Check

setLanguage and isLanguageAvailable are listed for Android, iOS, Web and macOS.

print(await tts.isLanguageAvailable("en-US"));

2Fix

Test availability before setting the language, and fall back to another locale.

if (await tts.isLanguageAvailable("en-US")) {
  await tts.setLanguage("en-US");
}

3Verify

Speak a phrase after setting the language.

await tts.speak("Hello");

Confirmed by pub.dev

Did this fix it?

How do I stop it coming back?

  • Test on a real device for each platform, not only on an emulator.
  • Call setLanguage after checking isLanguageAvailable, never blindly.
  • Keep one FlutterTts instance and configure it once at start-up.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.