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

V4.5.1 Join Call Error - Expo 52 New Arch #849

Open
JoaoPauloCMarra opened this issue Jan 28, 2025 · 6 comments
Open

V4.5.1 Join Call Error - Expo 52 New Arch #849

JoaoPauloCMarra opened this issue Jan 28, 2025 · 6 comments

Comments

@JoaoPauloCMarra
Copy link

JoaoPauloCMarra commented Jan 28, 2025

Cannot read property '_event_handlers' of undefined
It points to this line

happens after rtcEngine.joinChannel

works until I enable one of those:

// rtcEngine.addListener('onJoinChannelSuccess', onJoinChannelSuccess);
// rtcEngine.addListener('onLeaveChannel', onLeaveChannel);
// rtcEngine.addListener('onUserJoined', onUserJoined);
// rtcEngine.addListener('onUserOffline', onUserOffline);
// rtcEngine.addListener(
// 	'onRemoteVideoStateChanged',
// 	onRemoteVideoStateChanged,
// );
// rtcEngine.addListener(
// 	'onRemoteAudioStateChanged',
// 	onRemoteAudioStateChanged,
// );
// rtcEngine.add

same using registerEventHandler

// rtcEngine.registerEventHandler({
// 	onJoinChannelSuccess,
// 	onLeaveChannel,
// 	onUserJoined,
// 	onUserOffline,
// 	onRemoteVideoStateChanged,
// 	onRemoteAudioStateChanged,
// 	onError: onAgoraError,
// });
@guoxianzhe
Copy link
Contributor

@JoaoPauloCMarra It looks like you doesn't want register any EventHandler and it will cause error, am I right?

@JoaoPauloCMarra
Copy link
Author

JoaoPauloCMarra commented Jan 29, 2025

@JoaoPauloCMarra It looks like you doesn't want register any EventHandler and it will cause error, am I right?

I need the events to handle some actions. But If I register them the app crashes after joining a call

It was working a couple months ago with the same code and events enabled

the code for the hook

https://gist.github.com/JoaoPauloCMarra/e94d949280e03f02c88b8c493d8a94f6

@guoxianzhe
Copy link
Contributor

@JoaoPauloCMarra
Copy link
Author

JoaoPauloCMarra commented Jan 29, 2025

@JoaoPauloCMarra https://gist.github.com/JoaoPauloCMarra/e94d949280e03f02c88b8c493d8a94f6#file-useagorartcengine-ts-L6 Can you change it to useRef, I recommond you store rtcEngine object in ref insted of state. sample code: https://github.com/AgoraIO-Extensions/react-native-agora/blob/main/example/src/examples/hook/hooks/useInitRtcEngine.tsx#L27

even with useRef It didnt work. the engine is working, and the join works, but the events are not working.

btw const [rtcEngine] = useState<IRtcEngine>(createAgoraRtcEngine()); should work better than useRef.
also tried the instance outside the hook...
the engine instance is not the issue here, the events are.

@guoxianzhe
Copy link
Contributor

Weird, I try to repro this issues with https://github.com/AgoraIO-Extensions/react-native-agora/blob/main/example/src/examples/hook/JoinChannelVideo/JoinChannelVideo.tsx#L106 , but it seems fine.
Can you try to run the demo and check ? Currently we are in vacation(Chinese New Year) and we can not get more help for you quickly, Sorry!

@JoaoPauloCMarra
Copy link
Author

Weird, I try to repro this issues with https://github.com/AgoraIO-Extensions/react-native-agora/blob/main/example/src/examples/hook/JoinChannelVideo/JoinChannelVideo.tsx#L106 , but it seems fine. Can you try to run the demo and check ? Currently we are in vacation(Chinese New Year) and we can not get more help for you quickly, Sorry!

I tried every exemple, but It always points RtcEngineExInternal._event_handlers, saying RtcEngineExInternal is undefined.

Image

It's an Agora paying client, anyone else can help?

@JoaoPauloCMarra JoaoPauloCMarra changed the title V4.5.1 Join Call Error V4.5.1 Join Call Error - Expo 52 Jan 29, 2025
@JoaoPauloCMarra JoaoPauloCMarra changed the title V4.5.1 Join Call Error - Expo 52 V4.5.1 Join Call Error - Expo 52 New Arch Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants