Voice: IOS crash when use Voice.start('en-US').

Created on 6 Nov 2018  路  9Comments  路  Source: react-native-voice/voice

It works fine on android, but on IOS it crashed when I used the function Voice.start('en-US').
Has anyone encountered this problem yet? I can't find log error, plz help me
XCode 10.
IOS 12.
React native: 0.57.3

Most helpful comment

@sibelius Thanks. It works perfectly now.

Just as a reference for other users, I've used this command:
npm install --save git+https://github.com/wenkesj/react-native-voice.git#master

@pekubu
You should wrap your code in a try/catch and handle the crash.

All 9 comments

@pekubu Mine doesn't crash but on iOS, after the function Voice.start('en-US') is invoked the sound from the case speakers gets shifted to the ear speakers when the function Tts.speak() gets invoked.

XCode 10
iOS 12.0.1
react-native: 0.57.2
react-native-tts: "^2.0.0"
react-native-voice: "^0.2.6"

In your case, it could be maybe related with your app's permission to access the SpeechRecognition.

Check if you have the entry below in your Info.plist file.

key "Privacy - Speech Recognition Usage Description"
value: "$(PRODUCT_NAME) speech use"

Cheers

try to use master instead

@gglee89 @sibelius Thank you so much.
I used master, It working.
But sometimes it still crashed (When the recognizer finishes, Frequency is about 1/20)

@sibelius Thanks. It works perfectly now.

Just as a reference for other users, I've used this command:
npm install --save git+https://github.com/wenkesj/react-native-voice.git#master

@pekubu
You should wrap your code in a try/catch and handle the crash.

not working for me
this is package.json i am using

"react-native-voice": "git+https://github.com/wenkesj/react-native-voice.git#master",

this is how i init the plugin

  try {
            await Voice.start('en-US');
        } catch (e) {
            //eslint-disable-next-line
            console.error(e);
        }

@tahir-jamil
Are there any specific errors?

Looks like it's happening only with latest react-native versions.
I tried upgrading my app from "react-native": "0.59.9" to "react-native": "0.61.1" crashing the app.
Works great with "react-native": "0.59.9".

Has there been any updates on this? i'm on "react-native": "^0.62.2"

I'd love to know if there have been any updates as well 馃檹

Was this page helpful?
0 / 5 - 0 ratings