Skip to content

Declare TTS_SERVICE <queries> in the plugin manifest so consumers inherit it#641

Open
aki1770-del wants to merge 1 commit into
dlutton:masterfrom
aki1770-del:fix/example-tts-queries
Open

Declare TTS_SERVICE <queries> in the plugin manifest so consumers inherit it#641
aki1770-del wants to merge 1 commit into
dlutton:masterfrom
aki1770-del:fix/example-tts-queries

Conversation

@aki1770-del

Copy link
Copy Markdown

Fixes the root cause behind #255 / #449. The example app gained its own <queries> in 43c527c, but apps consuming the plugin still silently fail on Android 11+ unless they discover the README step. Declaring the <queries> intent in the plugin's library manifest lets Android's manifest merger propagate it into every consuming app, so getEngines/getLanguages work out of the box.

Verification (build-verified locally before submitting; Android 11 / API 30 emulator, Google TTS):

  • Merged-manifest check: TTS_SERVICE query count in the consuming app's merged manifest: 0 → 1 with this change (control app had no query of its own).
  • Without the fix: "Choose an engine" empty, "No data to load voices" (the exact Example code not loading engines or languages on emulator #255 / Can't run on android 13 #449 symptom). With the fix: engines and languages enumerate normally (Default Engine: com.google.android.tts in logcat).
  • flutter build apk --debug green before and after.

The README guidance remains valid for apps that also query TTS engines directly; with this change it is no longer required just to make the plugin work.

…utton#449)

Since Android 11, package visibility hides TTS engines from apps that do
not declare android.intent.action.TTS_SERVICE in <queries>. The README
documents the app-side workaround, but apps that miss it get an empty
engine/language list. Declaring the query in the plugin's own library
manifest lets the Android manifest merger propagate it into every
consuming app, making the README step unnecessary.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant