Samsung Galaxy A54 5G sample app crash on launch due to ZoomVideoSDKVideoHelper.rotateMyVideo(int)' on a null object reference

Description
Samsung Galaxy A54 5G sample app crash on launch due to:
ZoomVideoSDKVideoHelper.rotateMyVideo(int)’ on a null object reference

commenting out (in Android studio) this line
protected void refreshRotation() {
int displayRotation = display.getRotation();
// boolean ret = ZoomVideoSDK.getInstance().getVideoHelper().rotateMyVideo(displayRotation);
}
temporary resolve the crash and the app work as expected

Errors
FATAL EXCEPTION: main
Process: com.ekaansh.zoomexpo, PID: 28549
java.lang.NullPointerException: Attempt to invoke interface method ‘boolean us.zoom.sdk.ZoomVideoSDKVideoHelper.rotateMyVideo(int)’ on a null object reference
at com.reactnativezoom.videosdk.RNZoomViewManager.refreshRotation(RNZoomViewManager.java:230)
at com.reactnativezoom.videosdk.RNZoomViewManager$1.onDisplayChanged(RNZoomViewManager.java:220)
at android.hardware.display.DisplayManagerGlobal$DisplayListenerDelegate.handleMessage(DisplayManagerGlobal.java:1774)
at android.hardware.display.DisplayManagerGlobal$DisplayListenerDelegate.lambda$sendDisplayEvent$0(DisplayManagerGlobal.java:1742)
at android.hardware.display.DisplayManagerGlobal$DisplayListenerDelegate.$r8$lambda$aO0d1U2yv7-42_0MvY8uEf7AtpE(Unknown Source:0)
at android.hardware.display.DisplayManagerGlobal$DisplayListenerDelegate$$ExternalSyntheticLambda0.run(Unknown Source:6)
at android.os.Handler.handleCallback(Handler.java:958)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:230)
at android.os.Looper.loop(Looper.java:319)
at android.app.ActivityThread.main(ActivityThread.java:8919)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
2025-04-09 16:26:06.560 772-772 Layer surfaceflinger

Which React Native Video SDK version?
@zoom/react-native-videosdk”: “^1.13.10”, (from sample app)
Trying to upgrade to
@zoom/react-native-videosdk”: “^1.13.12”, or even
@zoom/react-native-videosdk”: “^2.1.10”,
did not fix the issue

Video SDK Code Snippets
Just running the sample app and launching the app on Samsung Galaxy A54 5G
videosdk-reactnative-quickstart

To Reproduce(If applicable)
Steps to reproduce the behavior:

  1. Clone videosdk-reactnative-quickstart
  2. run yarn
  3. run npx expo start
  4. run npx expo run:android --device
  5. App is build and installed on Samsung Galaxy A54 5G
  6. Open the app - app crash
  7. check logcat error -ZoomVideoSDKVideoHelper.rotateMyVideo(int) on a null object reference

Screenshots
N/A

Troubleshooting Routes

This is happening on the videosdk-reactnative-quickstart
Commenting out the related code with Android studio temporary avoid the crash

Smartphone (please complete the following information):

  • Device: Samsung Galaxy A54 5G
  • OS: Android version 14 , One UI version 6.1

Additional context
N/A

HI @Yohay,

Thanks for detailing the issue you’re facing and walking through it with me during developer office hours. After looking into it a bit more, this issue might be due to Android’s DisplayManager triggering onDisplayChanged before the Zoom session has started. This would cause the error-causing method to happen too soon and lead to the crash. Adding a null check could possibly help prevent this.

@ekaansh.zoom @ticorrian.heard could you either of you speak more to this issue and provide a fix? The developer is running into this issue when attempting to build the app from this blog.

Best,
Rehema

Hi @Yohay are you seeing the same error with the latest version of the SDK (v2.1.10)? I updated the GitHub repo to use the latest release here.

Hi,
Yes just pulled the last version with
@zoom/react-native-videosdk”: “^2.1.10”, and the app still crash on Android as soon as app open with the same error I also had to change

minSdkVersion = Integer.parseInt(findProperty(‘android.minSdkVersion’) ?: ‘24’) to minSdkVersion = Integer.parseInt(findProperty(‘android.minSdkVersion’) ?: ‘26’) Otherwise npx expo run:android --device failed

1 Like

Hey @Yohay, I put together a repro for using rotateMyVideo here: feat: repro rotate · EkaanshArora/vsdk-rn-rotate-repro@24ba089 · GitHub.
This is working as expected for me on @zoom/react-native-videosdk v2.1.10

const [rotation, setRotation] = useState(false);
  const onPressVideo = async () => {
    !rotation ? await zoom.videoHelper.rotateMyVideo(90) : await zoom.videoHelper.rotateMyVideo(0);
    setRotation(!rotation);
  };

The minSdkVersion is a good callout, I’ll check with the team if we can avoid having the user change this manually, thanks!

Hi Ekaansh,

Thanks for the update,
However my issue that the sample app crash on Android immediately when app open, I don’t even try to rotate the camera it just crashes soon as the app open
This is a Native Android crash - it may only happen on my test device (Samsung Galaxy A54 5G) or may be a larger issue with Samsung devices in general
If you don’t have access to this or similar device you can try Samsung free to try remote-test-lab service

I pinpoint the crash to native Android code in the SDK:

protected void refreshRotation() {
int displayRotation = display.getRotation();
->> boolean ret = ZoomVideoSDK.getInstance().getVideoHelper().rotateMyVideo(displayRotation);
}

I’m going to use a local patch by commenting out this line to temporary override the crash but will appreciate if Zoom team can investigate and fix this native crash

I’ll work with engineering to investigate if this is a device specific bug, thanks for your help on this!

Can confirm that this also happens to non-samsung devices

  • RMP2204 (SP1A.210812.016)
  • Android 13

First encountered in "@zoom/react-native-videosdk": "1.13.10"

Tried to update to 2.1.10, same error
Tried 1.13.12, same error

Attempt to invoke interface method 'boolean us.zoom.sdk.ZoomVideoSDKVideoHelper.rotateMyVideo(int)' on a null object reference

I can provide a sentry log if that would help narrow it down.

@Yohay @Ray_Arvin We have a 2.2.0 release that fixes this issue, can you please try and let us know if it works? Thank you!

1 Like