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

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.

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( at org.webrtc.voiceengine.VoiceEngineCompat.selectAudioDeviceAPIType( at org.webrtc.voiceengine.VoiceEngineCompat.isBluetoothScoCupported( at us.zoom.internal.SDKApplication.onSDKCreated( at us.zoom.internal.SDKApplication.initializeForSDK( at us.zoom.sdk.d.initialize( at com.reactnativezoom.videosdk.RNZoomVideoSdkModule$ at android.os.Handler.handleCallback(

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

Video SDK Code Snippets

  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:

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