Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invariant Violation: new NativeEventEmitter() requires a non-null argument. | Expo #272

Open
benedictpmateo opened this issue Nov 15, 2022 · 2 comments

Comments

@benedictpmateo
Copy link

Describe the bug
When I try to use the zip function it shows this error in expo v45

Invariant Violation: `new NativeEventEmitter()` requires a non-null argument.
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:95:17 in reportException
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:141:19 in handleException
at node_modules/react-native/Libraries/Core/setUpErrorHandling.js:24:39 in handleError
at node_modules/@react-native/polyfills/error-guard.js:49:36 in ErrorUtils.reportFatalError
at node_modules/metro-runtime/src/polyfills/require.js:203:40 in guardedLoadModule
at http://192.168.1.3:19000/src/app/index.bundle?platform=ios&dev=true&hot=false&strict=false&minify=false:244873:3 in global code

Invariant Violation: "main" has not been registered. This can happen if:
* Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
* A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called.
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:95:17 in reportException
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:141:19 in handleException
at node_modules/react-native/Libraries/Core/setUpErrorHandling.js:24:39 in handleError
at node_modules/@react-native/polyfills/error-guard.js:49:36 in ErrorUtils.reportFatalError

To Reproduce
Here's my dependencies in package.json

  "dependencies": {
    "@react-navigation/native": "^6.0.10",
    "expo": "^45.0.0",
    "expo-file-system": "~14.0.0",
    "expo-media-library": "~14.1.0",
    "expo-notifications": "~0.15.4",
    "expo-status-bar": "~1.3.0",
    "react": "17.0.2",
    "react-dom": "17.0.2",
    "react-native": "0.68.2",
    "react-native-zip-archive": "^6.0.8",
    "expo-sharing": "~10.2.0"
  }

Expected behavior
I'm currently trying to zip the files I downloaded using expo-filesystem then move the zip file to ios Sharing folder

Env (please complete the following information):

  • Device: iPhone 11
  • OS: iOS
  • OS Version: 16
  • Package Version: 6.0.8
@padge
Copy link

padge commented Nov 26, 2022

@benedictpmateo I had this issue as well, even after a cd ios; pod install. It worked after I uninstalled the app, deleted all pods rm -rf ios/Pods/*, re-ran pod install, then re-build and run.

@plrthink plrthink removed their assignment Nov 27, 2022
@sskohli01
Copy link

as per this comment, https://stackoverflow.com/questions/69538962/new-nativeeventemitter-was-called-with-a-non-null-argument-without-the-requir/69649068#69649068
in react-native-zip-archive/index.js
line 9
change const rnzaEmitter = new NativeEventEmitter(RNZipArchive);
to
const rnzaEmitter = new NativeEventEmitter();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants