1

// No problem at all with this code
import {View, Text} from 'react-native'
const App = () => {
    return (
        <View>
            <Text>
                Test
            </Text>
        </View>
    )
}

export default App

OUTPUT: LOG  Running "Chat" with {"rootTag":161,"initialProps":{}}
info Reloading app...
 BUNDLE  ./index.js 

********************************************

// but as soon as I import

import {View, Text} from 'react-native'
import {Voximplant} from 'react-native-voximplant';  <--

const client = Voximplant.getInstance();   <--

const App = () => {
    
    return (
        <View>
            <Text>
                Test
            </Text>
        </View>
    )
}

export default App


// I get the following.
OUTPUT: LOG  Running "Chat" with {"rootTag":171,"initialProps":{}}
 ERROR  Invariant Violation: `new NativeEventEmitter()` requires a non-null argument., js engine: hermes


I have try all the latest answers on GitHub and stack overflow but none of them work. At this point I don't know what to do. Do to this problem I am not able to use Voximplant.

{ "name": "Chat", "version": "0.0.1", "private": true, "scripts": { "android": "react-native run-android", "ios": "react-native run-ios", "lint": "eslint .", "start": "react-native start", "test": "jest" }, "dependencies": { "react": "18.2.0", "react-native": "0.71.5", "react-native-voximplant": "^1.36.0" }, "devDependencies": { "@babel/core": "^7.20.0", "@babel/preset-env": "^7.20.0", "@babel/runtime": "^7.20.0", "@react-native-community/eslint-config": "^3.2.0", "@tsconfig/react-native": "^2.0.2", "@types/jest": "^29.2.1", "@types/react": "^18.0.24", "@types/react-test-renderer": "^18.0.0", "babel-jest": "^29.2.1", "eslint": "^8.19.0", "jest": "^29.2.1", "metro-react-native-babel-preset": "0.73.9", "prettier": "^2.4.1", "react-test-renderer": "18.2.0", "typescript": "4.8.4" }, "jest": { "preset": "react-native" } }

Currently running on MacBook Pro M2, OS: macOs Ventura Version 13.3

1 Answers1

0

Just to make sure, did you run pod install in your ios folder after adding the new module?

That looks like an error when you install a new module but don't generate the pods for the iOS development.

Steps:

  1. Navigate to your ios folder within your react-native project.

  2. run pod install from the terminal.

  3. On Xcode, clean your project by using the shortcut cmd+shift+k. (Pro tip: you can delete the Derived Data folder within ~/Library/Developer/XCode/DerivedData, it will be generated again once you successfully build your app).

  4. Build your app (cmd+r);

KimioN42
  • 629
  • 1
  • 6
  • 10
  • 1. I have 'npm install react-native-voximplant —save' 2. I went to the iOS folder within react-native project 3. I have executed 'pod install'. $ Pod installation complete! There are 60 dependencies from the Podfile and 52 total pods installed. 4. I have open the project with Xcode and clean with cmd+shift+k 5. I have build the app with cmd+r 6. I have run the project one more time. $ LOG Running "ChatY" with {"rootTag":151,"initialProps":{}} ERROR Invariant Violation: `new NativeEventEmitter()` requires a non-null argument., js engine: hermes Still does not work. – Edgar Gallegos Apr 05 '23 at 03:22
  • It looks that there are many unsolved questions with the same error. At this point I don't know if react-native module it self or Voximplant. – Edgar Gallegos Apr 05 '23 at 04:05