Flutter - App crushed when add a participate into meeting

I used flutter_zoom_videodk package for intigrate Zoom video meeting which version is 1.14.0.

Basically, my token came from backend service. After I used the token, I successfully joined the session, and the show camera display was viewed perfectly. But a remote user tried to join the meeting, and then my app was crushed. I share my console in log below:

D/ZoomVideoSdkDebug(11102): Join Session successfully
D/ZoomVideoSdkDebug(11102): onError, error: ZoomVideoSDKError_Session_Already_In_Progress
I/GED (11102): ged_boost_gpu_freq, level 100, eOrigin 2, final_idx 2, oppidx_max 2, oppidx_min 0
W/.local_practice(11102): type=1400 audit(0.0:18413): avc: denied { ioctl } for path=“socket:[104193375]” dev=“sockfs” ino=104193375 ioctlcmd=0x8927 scontext=u:r:untrusted_app:s0:c229,c258,c512,c768 tcontext=u:r:untrusted_app:s0:c229,c258,c512,c768 tclass=udp_socket permissive=0 app=com.example.local_practice
W/.local_practice(11102): type=1400 audit(0.0:18414): avc: denied { ioctl } for path=“socket:[104193375]” dev=“sockfs” ino=104193375 ioctlcmd=0x8927 scontext=u:r:untrusted_app:s0:c229,c258,c512,c768 tcontext=u:r:untrusted_app:s0:c229,c258,c512,c768 tclass=udp_socket permissive=0 app=com.example.local_practice
W/Thread-36(11102): type=1400 audit(0.0:18415): avc: denied { ioctl } for path=“socket:[104192100]” dev=“sockfs” ino=104192100 ioctlcmd=0x8927 scontext=u:r:untrusted_app:s0:c229,c258,c512,c768 tcontext=u:r:untrusted_app:s0:c229,c258,c512,c768 tclass=udp_socket permissive=0 app=com.example.local_practice

I/flutter (11102): :white_check_mark: Session Joined: {sessionUser: {“isHost”:false,“customUserId”:“”,“isManager”:false,“userName”:“Test”,“userId”:“16778240”,“isVideoSpotLighted”:false}}
I/flutter (11102): :loud_sound: Audio Status Changed: {changedUsers: [{“isHost”:false,“customUserId”:“”,“isManager”:false,“userName”:“Test”,“userId”:“16778240”,“isVideoSpotLighted”:false}]}
D/ZoomVideoSdkDebug(11102): onUserVideoStatusChanged, userList: [{“isHost”:false,“customUserId”:“”,“isManager”:false,“userName”:“Test”,“userId”:“16778240”,“isVideoSpotLighted”:false}]
D/ZoomVideoSdkDebug(11102): onUserActiveAudioChanged, changedUsers:
I/flutter (11102): :video_camera: Video Status Changed: {changedUsers: [{“isHost”:false,“customUserId”:“”,“isManager”:false,“userName”:“Test”,“userId”:“16778240”,“isVideoSpotLighted”:false}]}
D/ZoomVideoSdkDebug(11102): onUserVideoStatusChanged, userList: [{“isHost”:false,“customUserId”:“”,“isManager”:false,“userName”:“Test”,“userId”:“16778240”,“isVideoSpotLighted”:false}]
I/flutter (11102): :video_camera: Video Status Changed: {changedUsers: [{“isHost”:false,“customUserId”:“”,“isManager”:false,“userName”:“Test”,“userId”:“16778240”,“isVideoSpotLighted”:false}]}
D/ZoomVideoSdkDebug(11102): onCommandChannelConnectResult, success: true
D/ZoomVideoSdkDebug(11102): onUserActiveAudioChanged, changedUsers:
D/ZoomVideoSdkDebug(11102): onCloudRecordingStatus, status: ZoomVideoSDKRecordingStatus_Start
D/ZoomVideoSdkDebug(11102): onCloudRecordingStatus handler != null
E/ActivityThread(11102): Failed to find provider info for com.oplus.statistics.provider
E/OplusStatistics–(11102): IllegalArgumentException:java.lang.IllegalArgumentException: Unknown URL content://com.oplus.statistics.provider/track_event
D/AudioManagerExtImpl(11102): getStreamVolume packageName=com.example.local_practice, index=1, streamType=0
D/AudioManagerExtImpl(11102): getStreamVolume packageName=com.example.local_practice, index=1, streamType=0
D/ZoomVideoSdkDebug(11102): onUserJoin, userList: [{“isHost”:true,“customUserId”:“”,“isManager”:false,“userName”:“zawad”,“userId”:“16793600”,“isVideoSpotLighted”:false}]
D/ZoomVideoSdkDebug(11102): onUserHostChanged, changedUser: {“isHost”:true,“customUserId”:“”,“isManager”:false,“userName”:“zawad”,“userId”:“16793600”,“isVideoSpotLighted”:false}
I/flutter (11102): :white_check_mark: User Joined: {remoteUsers: [{“isHost”:true,“customUserId”:“”,“isManager”:false,“userName”:“zawad”,“userId”:“16793600”,“isVideoSpotLighted”:false}], joinedUsers: [{“isHost”:true,“customUserId”:“”,“isManager”:false,“userName”:“zawad”,“userId”:“16793600”,“isVideoSpotLighted”:false}]}
D/ZoomVideoSdkDebug(11102): onUserManagerChanged, changedUser: {“isHost”:true,“customUserId”:“”,“isManager”:false,“userName”:“zawad”,“userId”:“16793600”,“isVideoSpotLighted”:false}

D/ZoomVideoSdkDebug(11102): onUserVideoStatusChanged, userList: [{“isHost”:true,“customUserId”:“”,“isManager”:false,“userName”:“zawad”,“userId”:“16793600”,“isVideoSpotLighted”:false}]

I/flutter (11102): :video_camera: Video Status Changed: {changedUsers: [{“isHost”:true,“customUserId”:“”,“isManager”:false,“userName”:“zawad”,“userId”:“16793600”,“isVideoSpotLighted”:false}]}
D/ZoomVideoSdkDebug(11102): onUserAudioStatusChanged, userList: [{“isHost”:true,“customUserId”:“”,“isManager”:false,“userName”:“zawad”,“userId”:“16793600”,“isVideoSpotLighted”:false}]
I/flutter (11102): :loud_sound: Audio Status Changed: {changedUsers: [{“isHost”:true,“customUserId”:“”,“isManager”:false,“userName”:“zawad”,“userId”:“16793600”,“isVideoSpotLighted”:false}]}
D/ZoomVideoSdkDebug(11102): onUserLeave, userList: [{“isHost”:false,“customUserId”:“”,“isManager”:false,“userName”:“zawad”,“userId”:“16793600”,“isVideoSpotLighted”:false}]
I/flutter (11102): :x: User Left: {remoteUsers: , leftUsers: [{“isHost”:false,“customUserId”:“”,“isManager”:false,“userName”:“zawad”,“userId”:“16793600”,“isVideoSpotLighted”:false}]}
D/AndroidRuntime(11102): Shutting down VM
E/AndroidRuntime(11102): FATAL EXCEPTION: main
E/AndroidRuntime(11102): Process: com.example.local_practice, PID: 11102
E/AndroidRuntime(11102): java.lang.NullPointerException: Attempt to invoke interface method ‘java.lang.String us.zoom.sdk.ZoomVideoSDKUser.getUserID()’ on a null object reference
E/AndroidRuntime(11102): at com.flutterzoom.videosdk.FlutterZoomVideoSdkUser.jsonUser(FlutterZoomVideoSdkUser.java:54)
E/AndroidRuntime(11102): at com.flutterzoom.videosdk.FlutterZoomVideoSdkPlugin.onUserHostChanged(FlutterZoomVideoSdkPlugin.java:1085)
E/AndroidRuntime(11102): at us.zoom.internal.ZoomVideoSDKDelegateHelper$1$12.run(ZoomVideoSDKDelegateHelper.java:2)
E/AndroidRuntime(11102): at android.os.Handler.handleCallback(Handler.java:938)
E/AndroidRuntime(11102): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(11102): at android.os.Looper.loopOnce(Looper.java:233)
E/AndroidRuntime(11102): at android.os.Looper.loop(Looper.java:344)
E/AndroidRuntime(11102): at android.app.ActivityThread.main(ActivityThread.java:8249)
E/AndroidRuntime(11102): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(11102): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:589)
E/AndroidRuntime(11102): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1071)
I/Process (11102): Sending signal. PID: 11102 SIG: 9

@richard.zoom

Hi as the error states you called getUserID method on a null reference, before calling the method please check that the user reference exists.

Thank you for the reply.

Basically, when I joined the session with no host role, it was okay and showed the camera view perfectly. After that host user want to join the session as a host, and then my app crashed. If you see my console log, then you will see that a user which isHost property is true And userId also not null.

I gave some console log print is given below for better understand:

→ Zoom SDK initialized successfully.

:white_check_mark: Session Joined: {sessionUser: {“isHost”:false,“customUserId”:“”,“isManager”:false,“userName”:“Test”,“userId”:“16778240”,“isVideoSpotLighted”:false}} (It’s me).

→ I/flutter (18260): :loud_sound: Audio Status Changed: {changedUsers: [{“isHost”:false,“customUserId”:“”,“isManager”:false,“userName”:“Test”,“userId”:“16778240”,“isVideoSpotLighted”:false}]}

→ D/ZoomVideoSdkDebug(18260): onUserVideoStatusChanged, userList: [{“isHost”:false,“customUserId”:“”,“isManager”:false,“userName”:“Test”,“userId”:“16778240”,“isVideoSpotLighted”:false}]

→ D/ZoomVideoSdkDebug(18260): onUserActiveAudioChanged, changedUsers:
I/flutter (18260): :video_camera: Video Status Changed: {changedUsers: [{“isHost”:false,“customUserId”:“”,“isManager”:false,“userName”:“Test”,“userId”:“16778240”,“isVideoSpotLighted”:false}]}

→ D/ZoomVideoSdkDebug(18260): onUserVideoStatusChanged, userList: [{“isHost”:false,“customUserId”:“”,“isManager”:false,“userName”:“Test”,“userId”:“16778240”,“isVideoSpotLighted”:false}]

→ I/flutter (18260): :video_camera: Video Status Changed: {changedUsers: [{“isHost”:false,“customUserId”:“”,“isManager”:false,“userName”:“Test”,“userId”:“16778240”,“isVideoSpotLighted”:false}]}

// This is all parts of my join session and display camera view.
Now I share all console log when a host join.

→ D/ZoomVideoSdkDebug(18260): onUserJoin, userList: [{“isHost”:true,“customUserId”:“”,“isManager”:false,“userName”:“zawad”,“userId”:“16792576”,“isVideoSpotLighted”:false}]

→ D/ZoomVideoSdkDebug(18260): onUserHostChanged, changedUser: {“isHost”:true,“customUserId”:“”,“isManager”:false,“userName”:“zawad”,“userId”:“16792576”,“isVideoSpotLighted”:false}

→ D/ZoomVideoSdkDebug(18260): onUserManagerChanged, changedUser: {“isHost”:true,“customUserId”:“”,“isManager”:false,“userName”:“zawad”,“userId”:“16792576”,“isVideoSpotLighted”:false}

→ D/ZoomVideoSdkDebug(18260): onUserVideoStatusChanged, userList: [{“isHost”:true,“customUserId”:“”,“isManager”:false,“userName”:“zawad”,“userId”:“16792576”,“isVideoSpotLighted”:false}]

→ D/ZoomVideoSdkDebug(18260): onUserAudioStatusChanged, userList: [{“isHost”:true,“customUserId”:“”,“isManager”:false,“userName”:“zawad”,“userId”:“16792576”,“isVideoSpotLighted”:false}]

That’s all parts of log when a host join.

At this time onUserLeave event is triggered. Then host left. After that app crashed.

The app crash error came from the native side. i am not the native android developer. So please help me to figure out the issue and give me proper guidelines.

Thanks in advance.

@ekaansh.zoom

Can you share the onUserLeave event listener code? Somewhere in your app you’re calling a method that’s using the userId of a null user, it’s hard to say where exactly but I would double check the leave callback to see if that has any reference that might be null.

@ekaansh.zoom
I’m also facing similar problem on v1.12.10. As @Mahabub1 mentioned, when host user joined/leaved, app sometimes crash.

The error is coming from the onUserHostChanged event handler, where getUserId() is returning null. This happens inside the FlutterZoomVideoSdkPlugin.java, so I can’t avoid it even if I use getUserId() in my code.

Therefore, I also hope the SDK will be fixed.

It looks like your app is crashing due to a NullPointerException when trying to access the getUserID() method on a null object. This usually happens when a user reference is missing or has already been removed from the session.

You might want to check if the user object is null before calling getUserID(), especially in the onUserHostChanged method. Adding a null check before accessing user properties should help prevent crashes.

Hello @Mahabub1 , @ysohma ,

Can you please upgrade to the latest Zoom Video SDK for Flutter version 2.1.10 and let us know if this error still occurs there?

Thank you for your patience,
Richard