Essentials: [Bug] [iOS] TextToSpeech crash in Release

Created on 3 Apr 2020  路  18Comments  路  Source: xamarin/Essentials

Description

App crashes in release (TestFlight) when using TextToSpeech (there is everything alright in debug though). I logged the exception and it throws the following message:

The lazily-initialized type does not have a public, parameterless constructor.

Steps to Reproduce

Call TextToSpeech.SpeakAsync (release mode)

Expected Behavior

Voice is starting to pronounce text.

Actual Behavior

App crashes.

Basic Information

  • Version with issue: 1.5.1, 1.5.2
  • Last known good version: N/A
  • IDE: Visual Studio for Mac Community 8.5.1 (build 42)
  • Platform Target Frameworks:

    • iOS:

    • Deployment target: 8.0

    • Tested device version: 13.3.1

  • Affected Devices: iPhone 8 Plus

Reproduction Link

Here you can find how the code used.

bug in-progress

Most helpful comment

No problem, I'm glad I was able to help with this issue 馃檪

All 18 comments

Looks like the linker is being a bit aggressive. That code was re-architected with a lazy so let me update and get you a nuget to try asap.

I am curious as a workaround if you do something like this in your AppDelegate:

var test = new AVSpeechSynthesizer();

that may keep it linked in.

Looks like the linker is being a bit aggressive. That code was re-architected with a lazy so let me update and get you a nuget to try asap.

Thanks for the fast reply. Will be waiting for it :slightly_smiling_face:

I am curious as a workaround if you do something like this in your AppDelegate:

var test = new AVSpeechSynthesizer();

that may keep it linked in.

I've started the build, it may take some time to deploy.

I am curious as a workaround if you do something like this in your AppDelegate:

var test = new AVSpeechSynthesizer();

that may keep it linked in.

Yeah, with this line it is working now (tested in TestFlight version).

Fantastic! yeah, just the linker was removing. We will hot fix it.

Can you remove that line and try out this NuGet -> https://dev.azure.com/xamarin/public/_build/results?buildId=16377&view=artifacts&type=publishedArtifacts

This NuGet is working too 馃檪

Can I bother you to try this one: https://dev.azure.com/xamarin/public/_build/results?buildId=16434&view=artifacts&type=publishedArtifacts

I did a different work around that I think is better. Sorry to keep asking :)

No problem, you may contact me as much as you need 馃檪

Unfortunately, with this NuGet app crashes. I will check the error.

The same error: TextToSpeech error: The lazily-initialized type does not have a public, parameterless constructor.

Got it! Let me try one more thing :)

Yup, it's working

YAY! <3 thanks!

No problem, I'm glad I was able to help with this issue 馃檪

Will be in 1.5.3

Hi @jamesmontemagno Can you tell us by when can we expect release 1.5.3 ?

Any estimate when 1.5.3 will be out?

We are working on getting it out soon.

For a workaround just add this to your AppDelegate:

var test = new AVSpeechSynthesizer();
Was this page helpful?
0 / 5 - 0 ratings