muhaos / react-native-speech-to-text-ios

React Native speech recognition component for iOS 10+
MIT License
40 stars 9 forks source link

SpeechToText returning undefined #9

Closed bob-zs closed 6 years ago

bob-zs commented 7 years ago

Ran:

import SpeechToText from 'react-native-speech-to-text-ios';

However, the console states that SpeechToText is undefined

muhaos commented 7 years ago

Have you done react-native link react-native-speech-to-text-ios ?

bob-zs commented 6 years ago

@muhaos, yes, I have. And I figured out the issue. I had to run npm install and pod install multiple times, and I tried building with xcode, and the error 'RCTBridgeModule.h' file not found

Basically, I was using a later version of npm and react-native, and the headers <React/RCT*.h> had to not have React in it. Changing all those files, the SpeechToText finally is not undefined.

The issue below helped.

https://github.com/oblador/react-native-vector-icons/issues/380