Android Crash: SendbirdChat instance hasn't been initialized

i am currently using sendbird uikit for chat in android app. but sometimes app crashes with this stacktrace in release mode:

Caused by java.lang.RuntimeException: SendbirdChat instance hasn’t been initialized.
at com.sendbird.android.SendbirdChat.sendbirdChatMain$sendbird_release(SendbirdChat.kt:123)
at com.sendbird.android.SendbirdChat.sendbirdChatMain$sendbird_release$default(SendbirdChat.kt:119)
at com.sendbird.android.SendbirdChat.getSendbirdChatMain$sendbird_release(SendbirdChat.kt:112)
at com.sendbird.android.SendbirdChat.getAppInfo(SendbirdChat.kt:177)
at com.sendbird.uikit.fragments.BaseMessageListFragment.getMultipleFilesMessageFileCountLimit(BaseMessageListFragment.java:866)
at com.sendbird.uikit.fragments.BaseMessageListFragment.(BaseMessageListFragment.java:158)
at com.sendbird.uikit.fragments.ChannelFragment.(ChannelFragment.java:91)
at java.lang.reflect.Constructor.newInstance0(Constructor.java)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
at androidx.fragment.app.Fragment.instantiate(Fragment.java:672)
at androidx.fragment.app.FragmentContainer.instantiate(FragmentContainer.java:57)
at androidx.fragment.app.FragmentManager$3.instantiate(FragmentManager.java:525)
at androidx.fragment.app.FragmentState.instantiate(FragmentState.java:84)
at androidx.fragment.app.FragmentStateManager.(FragmentStateManager.java:91)
at androidx.fragment.app.FragmentManager.restoreSaveStateInternal(FragmentManager.java:2562)
at androidx.fragment.app.FragmentManager.attachController(FragmentManager.java:2722)
at androidx.fragment.app.FragmentController.attachHost(FragmentController.java:117)
at androidx.fragment.app.FragmentActivity.lambda$init$3(FragmentActivity.java:139)
at androidx.activity.contextaware.ContextAwareHelper.dispatchOnContextAvailable(ContextAwareHelper.java:84)
at androidx.activity.ComponentActivity.onCreate(ComponentActivity.java:377)
at androidx.fragment.app.FragmentActivity.onCreate(FragmentActivity.java:216)
at com.sendbird.uikit.activities.ChannelActivity.onCreate(ChannelActivity.java:68)
at android.app.Activity.performCreate(Activity.java:8767)
at android.app.Activity.performCreate(Activity.java:8745)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1519)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3928)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4126)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:108)
at android.app.servertransaction.TransactionExecutor.executeNonLifecycleItem(TransactionExecutor.java:195)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:157)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:90)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2544)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at android.app.ActivityThread.main(ActivityThread.java:8501)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)

Although, i am checking if sendbird chat sdk is initialized or not using “SendbirdChat.isInitialized”, i can’t find reason of app crash.

Any suggestions?
Thanks in advance.

Hello @sdr

  1. Please share the exact version details which you are using.

  2. If not using the latest version then can you please test it on the latest version and share your observations?

  3. Detailed Reproduction steps if the crash is reproducible.

  4. OS version, device type

  5. Did it suddenly happen without upgrading the SDK version?

  6. Env settings (i.e. xcode ver)

Hello @Chinmaya_Gupta

  1. Please share the exact version details which you are using.
    I am using latest version of sendbird uikit(3.15.0)

  2. Detailed Reproduction steps if the crash is reproducible.
    Sorry but i am unable to reproduce this crash

  3. OS version, device type
    Android 11,13 and 14

  4. Did it suddenly happen without upgrading the SDK version?
    No i am getting this crash in firebase for more than 3 months.

  5. Env settings
    I am using Android Studio Iguana | 2023.2.1 Patch 2