ios – How to resolve Invariant Violation: `new NativeEventEmitter()` requires a non-null argument. when using react-native-track player with expo workflow?


I am trying to build a track player in react native. I am using an expo managed workflow. I installed react-native-track player dependency using npx expo install react-native-track-player.

Further, I am starting a dev build using expo dev client with the command npx expo run:ios
I get following exceptions once I try to start the app on the ios simulator:

 ERROR  Invariant Violation: `new NativeEventEmitter()` requires a non-null argument., js engine: hermes
 ERROR  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., js engine: hermes
› Stopped server

We encounter this issue, even before registering the playback service, which leads me to believe that the issue is not caused by my code.

I am using following versions:

  • “react-native-track-player”: “^4.0.1”,
  • “expo”: “^49.0.0”,

And IOS version 17.0.1.

We already tried installing the pods with

cd ios && pod install

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img