Essentials: Failed to initialize Text to Speech engine. Exception.

Created on 28 Nov 2018  路  6Comments  路  Source: xamarin/Essentials

Bug report best practices: Submitting Issues

Description

Failed to initialize Text to Speech engine. Exception.

Steps to Reproduce

  1. Upgrade Xamarin.Essentials to the latest prerelease 0.11.0-preview.

Expected Behavior

Actual Behavior

Basic Information

  • Version with issue: 0.11.0-preview
  • Last known good version: None of them seems to work on Android 9.0
  • IDE: Visual Studio
  • Platform Target Frameworks: 28.0.0-preview 8

    • iOS:

    • Android: 9.0

    • UWP:

  • Android Support Library Version:
  • Nuget Packages: Xamarin.Essentials-v0.11.0-preview.
  • Affected Devices:

Screenshots

Reproduction Link

need-more-information

All 6 comments

Unable to reproduce this locally.

Can you provide a simple reproducible solution for us?

Additionally, where are you calling the code?

Hey guys, here is a reproducible solution.
https://github.com/Sergiojoel9877/XE.git
It uses the latest Xamarin Essentials nugget, XamarinForms 3.4.0, and the latest Android Support Libraries 28.0.0.0-preview8
@jamesmontemagno no matter the place [Code Behind, ViewModel], it always gives me that exception.

I believe your issue is that you are trying to call the speak code on a background task:

 Task.Factory.StartNew(async ()=>
            {

It has to be initialized on the UI thread. Remove this code and should be good.

This is not a supported scenario because TTS must be initialized and run on the UI Thread.

You can use:

SpeakAsync().ContinueWith((t)=>{});

Just after updating to the 1.0.0 version it got solved. Thanks guys.

Was this page helpful?
0 / 5 - 0 ratings