voice
voice copied to clipboard
Native module cannot be null
Bug
The error occurs once importing Voice.
Environment info
React native info output: React Native Environment Info: System: OS: macOS High Sierra 10.13.6 CPU: (8) x64 Intel(R) Core(TM) i7-2635QM CPU @ 2.00GHz Memory: 155.11 MB / 16.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 10.14.2 - ~/.nvm/versions/node/v10.14.2/bin/node npm: 6.4.1 - ~/.nvm/versions/node/v10.14.2/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1 IDEs: Android Studio: 3.2 AI-181.5540.7.32.5056338 Xcode: 10.1/10B61 - /usr/bin/xcodebuild npmPackages: react: 16.8.3 => 16.8.3 react-native: ^0.59.5 => 0.59.5 npmGlobalPackages: react-native-cli: 2.0.1
Library version: 0.3.0
Steps To Reproduce
Either link by using pods, or manually linking as the instruction describes, produces the same error.
Describe what you expected to happen:
- No crash/error.
I have been having this too. Heres how I solved this one.
- react-native init app-name && cd app-name
- yarn add react-native-voice
- cd ios
- pod install
- Edit ios/app-name/Info.plist and add the permissions from the readme.
- open the workspace in xcode
- run from xcode (you may be able to do this with react-native run-ios, I'm not sure)
I still dont have this lib working correctly but at least I'm past this error
I ran into the same issue. Nothing helps me. Are there any solutions here?
I ran into the same issue. Nothing helps me. Are there any solutions here?
I decided to point my installation to master: in package.josn "react-native-voice": "github:react-native-community/react-native-voice", Or npm install react-native-voice@'react-native-community/react-native-voice'
Then just follow the manual linking instructions.
I ran into the same issue. Nothing helps me. Are there any solutions here?
I decided to point my installation to master: in package.josn "react-native-voice": "github:react-native-community/react-native-voice", Or npm install react-native-voice@'react-native-community/react-native-voice'
Then just follow the manual linking instructions.
Thank you for help! But unfortunately, I'm still faced with this error (
make sure you do the following 2 things for iOS [https://github.com/react-native-community/react-native-voice#manually-link-ios]
- Drag the Voice.xcodeproj from the react-native-voice/ios folder to the Libraries group on Xcode in your poject. Manual linking
- Click on your main project file (the one that represents the .xcodeproj) select Build Phases and drag the static library, lib.Voice.a, from the Libraries/Voice.xcodeproj/Products folder to Link Binary With Libraries
I had the problem, and performed the 2 steps fixed the issue. Try clean the project and rebuild again? Good luck
@hokaiyipFS's solution worked, but I also had to run 'react-native unlink react-native-voice'
@chukwuezi did you solve your problem?
Adding the following line to my Podfile was necessary to build:
pod 'react-native-voice', :path => '../node_modules/@react-native-community/voice'
in my case, I run react-native link @react-native-community/voice navigate to the ios folder run pod install cleaned the project and rebuilt the error is gone. also in the constructor please make sure that you bind "this" keyword like this Voice.onSpeechStart = this.onSpeechStartHandler.bind(this);
Thanks for the bug report, ill checkout why the current NPM package is not working. The community package is deprecated.
I installed from NPM and I couldn't find lib.Voice.a, or the Libraries/Voice.xcodeproj/Products folder. But I found the libVoice.a binary by clicking the plus (+) button in "Build Phases > Link Binary with Libraries". Still haven't tested the build yet, just thought to add this info in case anyone else can't find the "Libraries/Voice.xcodeproj/Products" folder. YW :)