innFactory / react-native-dialogflow

A React-Native Bridge for the Google Dialogflow (API.AI) SDK
https://innfactory.de/softwareentwicklung/ui-ux/sprachsteuerung-mit-api-ai-in-einer-react-native-app/
MIT License
200 stars 64 forks source link

Crash when including 'react-native-dialogflow' #79

Open MaxenceEpitech opened 4 years ago

MaxenceEpitech commented 4 years ago

Hey, I have an empty react app with expo and when I add this line: import { Dialogflow_V2 } from 'react-native-dialogflow'; (same with import { Dialogflow } from 'react-native-dialogflow'; ) The app crash and I have this error message : image Any ideas ?

joe-pellegrino commented 4 years ago

I fixed the same issue by changing the package.json from 3.2.2 to 3.1.0. Deleting the module in node_modules, then running npm install.

mitchhh22 commented 4 years ago

@joe-pellegrino your suggestion did not work. I didn't try ejecting. Did you do something else?

draturi commented 4 years ago

@mitchhh22 I just got it working. I enacted what @joe-pellegrino said. changed package.json at root to "react-native-dialogflow": "3.1.0" then rm -r react-native-dialogflow in node_modules directory, then finally from the root dir of the project ran npm install

This lead to npm installing 3.1.0 and now the app doesn't crash on the Invariant Violation.... error

classicalguss commented 4 years ago

I get a crash too. I'm using expo, and I'm trying to avoid ejecting. I also included the infoPlist in the app.json like this "ios": { "bundleIdentifier": "com.yasmina.yasmina", "infoPlist": { "NSSpeechRecognitionUsageDescription": "Your usage description here", "NSMicrophoneUsageDescription": "Your usage description here" } },

Downgrading to 3.1.0 will stop that error, but will give you other errors if you used Dialogflow_V2