AgoraIO-Community / VideoUIKit-ReactNative

A React Native package to simply integrate Agora Video Calling or Live Video Streaming to your app with just a few lines of code.
MIT License
93 stars 43 forks source link

Invariant Violation: "main" has not been registered #161

Open elieobeid7 opened 1 month ago

elieobeid7 commented 1 month ago

just following the tutorial on the readme

import React, {useState} from 'react';
import AgoraUIKit from 'agora-rn-uikit';

const App = () => {
  const [videoCall, setVideoCall] = useState(true);
  const connectionData = {
    appId: '<Agora App ID>',
    channel: 'test',
  };
  const rtcCallbacks = {
    EndCall: () => setVideoCall(false),
  };
  return videoCall ? (
    <AgoraUIKit connectionData={connectionData} rtcCallbacks={rtcCallbacks} />
  ) : (
    <Text onPress={()=>setVideoCall(true)}>Start Call</Text>
  );
};

export default App;

I get this error if I try to open the app on an android emulator

 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

and if I try to open it on expo go I get this error

 ERROR  Error: The package 'react-native-agora' doesn't seem to be linked. Make sure:

- You rebuilt the app after installing the package
- You are not using Expo Go
, js engine: hermes

I'm using the latest expo SDK and the latest agora sdk