react-native-tts
react-native-tts copied to clipboard
Critical error when trying to list voices?
Hey man, awesome library. Everything was going awesome till I upgraded to RN 0.50, then suddenly my app crashes whenever I call the voices()
method. I checked my logs and found the following:
Exception '-[AVSpeechSynthesisVoice identifier]: unrecognized selector sent to instance 0x7ffc1d4c3ff0' was thrown while invoking voices on target TextToSpeech with params (
6746,
6747
)
callstack: (
0 CoreFoundation 0x000000010d676f35 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010c7d2bb7 objc_exception_throw + 45
2 CoreFoundation 0x000000010d67e04d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x000000010d5d627c ___forwarding___ + 988
4 CoreFoundation 0x000000010d5d5e18 _CF_forwarding_prep_0 + 120
5 Linguistic 0x000000010be3d61c -[TextToSpeech voices:reject:] + 476
6 CoreFoundation 0x000000010d56ec8c __invoking___ + 140
7 CoreFoundation 0x000000010d56eae2 -[NSInvocation invoke] + 290
8 CoreFoundation 0x000000010d5fded6 -[NSInvocation invokeWithTarget:] + 54
9 Linguistic 0x000000010bca4c0c -[RCTModuleMethod invokeWithBridge:module:arguments:] + 2796
10 Linguistic 0x000000010bd3b582 _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 786
11 Linguistic 0x000000010bd3b0af _ZZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEiENK3$_0clEv + 127
12 Linguistic 0x000000010bd3b029 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 25
13 libdispatch.dylib 0x000000011045aaf6 _dispatch_call_block_and_release + 12
14 libdispatch.dylib 0x0000000110474af4 _dispatch_client_callout + 8
15 libdispatch.dylib 0x000000011045f8cf _dispatch_queue_drain + 733
16 libdispatch.dylib 0x000000011045f494 _dispatch_queue_invoke + 217
17 libdispatch.dylib 0x00000001104613fa _dispatch_root_queue_drain + 479
18 libdispatch.dylib 0x00000001104622c9 _dispatch_worker_thread3 + 98
19 libsystem_pthread.dylib 0x00000001107e71ca _pthread_wqthread + 1387
20 libsystem_pthread.dylib 0x00000001107e6c4d start_wqthread + 13
)
which, from the looks of things, is coming from this line:
[voices addObject:@{@"id": voice.identifier, @"name": voice.name, @"language": voice.language}];
It seems like it can't find identifier
as a property of the voice
object, despite it being listed in the official docs. I'd try to fix it myself, but seeing it deals with native code I'm not even sure where I'd begin debugging it. Any idea what might be responsible for it?
@Nickersoft @ak1394 have you been able to resolve this? Seeing this show up in crashlytics as well.
I'm on RN: 0.53.3 and react-native-tts: 1.5.1