AVSpeechSynthesizer causing crashes on ios11.4

0

I got a crash relate AVSpeechSynthersizer. and my code is,

   AVSpeechUtterance *utterance = [[AVSpeechUtterance alloc] initWithString:text];

    utterance.rate = rate;
    utterance.pitchMultiplier = pitchMultiplier;
    utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:languageCode];
    _startTime = [[NSDate date] timeIntervalSince1970];
    [self.speechSynthesizer speakUtterance:utterance];

There is only one user case this crash. OS version is 11.4, device is iPhone6.

crash stack info:

Incident Identifier: 24E003DC-47C0-45B0-A22E-A351B2A8046A
CrashReporter Key:   c8844c975fe64b90aad2b813254959a928e4c4ea
Hardware Model:      iPhone7,2
Process:         qcs.r [779]
Path:            /var/containers/Bundle/Application/0242C042-0AE5-4033-AE07-D1BECD6DD910/qcs.r.app/qcs.r
Identifier:      com.meituan.qcs.r.ios
Version:         2.1.9 (1682)
Code Type:       ARM-64
Parent Process:  ? [1]

Date/Time:       2018-06-14 13:41:58.000 +0800
OS Version:      iOS 11.4 (15F79)
Report Version:  104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x00000000 at 0x0000000000000000
Crashed Thread:  53

Application Specific Information:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** +[NSString stringWithUTF8String:]: NULL cString
UserInfo:(null)'

Thread 53 Crashed:
0   CoreFoundation                  __exceptionPreprocess+ 228
1   libobjc.A.dylib                 objc_exception_throw (in libobjc.A.dylib) + 56
2   CoreFoundation                  -[NSException initWithCoder:]+ 0
3   Foundation                      +[NSString stringWithUTF8String:]+ 92
4   TTSSpeechBundle                 0x0000000105f87544 0x105f70000 + 95556
5   libsystem_pthread.dylib         _pthread_body (in libsystem_pthread.dylib) + 272
6   libsystem_pthread.dylib         _pthread_body (in libsystem_pthread.dylib) + 0
7   libsystem_pthread.dylib         thread_start (in libsystem_pthread.dylib) + 4
crash
text-to-speech
asked on Stack Overflow Jun 15, 2018 by user2189173

1 Answer

0

Could your text argument here be nil by any chance? initWithString:text

answered on Stack Overflow Jun 27, 2018 by bvsdev

User contributions licensed under CC BY-SA 3.0