Voice: [TypeError: undefined is not an object (evaluating 'Voice.startSpeech')]

Created on 20 Oct 2017  路  15Comments  路  Source: react-native-voice/voice

when i install this package and a call on button press: await Voice.start("en-US");

Genymotion cause this error

Any helps.

Most helpful comment

@24dev Hey having the same problem. Any suggestions because I am using this on Expo and it does not work.

All 15 comments

same isssue

same issue, on an android device, 'pt-BR'

same issue

Can you confirm you executed react-native link after installing?

hello! try these steps:

# uninstall app
# stop packager
watchman watch-del-all
rm -rf $TMPDIR/react-*
rm -rf $TMPDIR/haste-*
rm -rf $TMPDIR/metro-*
# restart packager
# run android

Is it possible to confirm if I've linked it correctly after installing?

I'm having the same problem, and I'm suspicious of the link.

I had the same problem. In my case, react-native link wasn't working.

After following the documentation for linking manually, I noticed this in MainApplication.java:

// Needed for `react-native link`
// import com.facebook.react.ReactApplication;
...

I uncommented that import statement and ran the react-native link react-native-voice command again. That solved the problem for me.

Guys ,plz help.i have the same problem.what can i do ? i respect every step and i install everything,i put react-native link,i uncommented the import from android,i do everything from the internet.i made a project with react init and other with create react native and i have the same error.Can someone help me plz?

check example

this only happens when Voice is undefined, so the link is wrong

relink and rebuild

image

this error

For anyone coming across this again, on top of linking (which didn't work even though it says it did), I had to follow the manual linking steps. This issue then went away and it works great!

@24dev can you please provide me the link for manual linking steps

Hey having the same problem. Any suggestions because I am using this on Expo and it does not work.

@24dev Hey having the same problem. Any suggestions because I am using this on Expo and it does not work.

Was this page helpful?
0 / 5 - 0 ratings