NullPointer exception on video-sdk initialize causing app crash -- React-Native Android

Description
On some devices, we get a NullPointer exception when loading the app from install.

The workaround is for the user to clear the app cache to make the app work. However, this is not possible for end-users.

Errors
java.lang.NullPointerException: Attempt to invoke interface method ‘java.lang.String android.content.SharedPreferences.getString(java.lang.String, java.lang.String)’ on a null object reference at com.zipow.videobox.util.PreferenceUtil.readStringValue(PreferenceUtil.java:5) at org.webrtc.voiceengine.VoiceEngineCompat.selectAudioDeviceAPIType(VoiceEngineCompat.java:1) at org.webrtc.voiceengine.VoiceEngineCompat.isBluetoothScoCupported(VoiceEngineCompat.java:33) at us.zoom.internal.SDKApplication.onSDKCreated(SDKApplication.java:50) at us.zoom.internal.SDKApplication.initializeForSDK(SDKApplication.java:8) at us.zoom.sdk.d.initialize(ZoomVideoSDKImpl.java:18) at com.reactnativezoom.videosdk.RNZoomVideoSdkModule$1.run(RNZoomVideoSdkModule.java:120) at android.os.Handler.handleCallback(Handler.java:914)

Which React Native Video SDK version?
@zoom1234/react-native-videosdk version 1.3.1

Video SDK Code Snippets
RNZoomVideoSdkModule.java

  @ReactMethod
  public void initSdk(ReadableMap config, Promise promise) {
  ...
        params.videoRawDataMemoryMode = RNZoomVideoSdkRawDataMemoryMode.valueOf(config.getString("videoRawDataMemoryMode"));
        params.audioRawDataMemoryMode = RNZoomVideoSdkRawDataMemoryMode.valueOf(config.getString("audioRawDataMemoryMode"));
        params.shareRawDataMemoryMode = RNZoomVideoSdkRawDataMemoryMode.valueOf(config.getString("shareRawDataMemoryMode"));

        ZoomVideoSDK sdk = ZoomVideoSDK.getInstance();
        int initResult = sdk.initialize(reactContext.getCurrentActivity(), params);
  ...
  }

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

  1. Generate release APK for android
  2. Install the APK
  3. Launch the app
  4. App crashes

Troubleshooting Routes

  1. Tried to catch the error and:
    a. programmatically clear any cache in the context
    b. set delay and try to re-initialize the sdk

Smartphone (please complete the following information):

  • Device: Android
  • OS: Android 10 QKQ1.190825.002

Additional context
Similar cases but with no clear resolution:
https://devforum.zoom.us/t/video-sdk-demo-app-crashes-when-starting/47005/3

This topic was automatically closed after 30 days. New replies are no longer allowed.