Suddenly TextToSpeech stopped working on the Pixel 3 I'm using for development.
It works normally on other development terminals such as Xperia.
TextToSpeech's onInitListener returns status = -1
It was officially written as follows.
Apps targeting Android 11 that use text-to-speech should declare TextToSpeech.Engine#INTENT_ACTION_TTS_SERVICE in the queries elements of their manifest:
If you add it to the manifest like the following, it will work.
AndroidManifest.xml
<manifest>
・ ・ ・
    <queries>
・ ・ ・
        <intent>
            <action android:name="android.intent.action.TTS_SERVICE" />
        </intent>
    </queries>
</manifest>
        Recommended Posts