# Android Crash: SendbirdChat instance hasn't been initialized

**URL:** <https://community.sendbird.com/t/android-crash-sendbirdchat-instance-hasnt-been-initialized/9257>\
**Category:** Android\
**Tags:** android, uikit\
**Created:** [March 26, 2024, 9:20am UTC](https://community.sendbird.com/t/android-crash-sendbirdchat-instance-hasnt-been-initialized/9257 "2024-03-26T09:20:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sdr](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@sdr](https://community.sendbird.com/u/sdr)\
**Post date:** [March 26, 2024, 9:20am UTC](https://community.sendbird.com/t/android-crash-sendbirdchat-instance-hasnt-been-initialized/9257/1 "2024-03-26T09:20:51Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Chinmaya\_Gupta](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/chinmaya_gupta/32/1021_2.png) [@Chinmaya\_Gupta](https://community.sendbird.com/u/Chinmaya_Gupta)\
**Post date:** [April 18, 2024, 12:32pm UTC](https://community.sendbird.com/t/android-crash-sendbirdchat-instance-hasnt-been-initialized/9257/2 "2024-04-18T12:32:29Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![sdr](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@sdr](https://community.sendbird.com/u/sdr)\
**Post date:** [April 18, 2024, 12:58pm UTC](https://community.sendbird.com/t/android-crash-sendbirdchat-instance-hasnt-been-initialized/9257/3 "2024-04-18T12:58:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Mitul\_Varmora](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/mitul_varmora/32/5635_2.png) [@Mitul\_Varmora](https://community.sendbird.com/u/Mitul_Varmora)\
**Post date:** [December 18, 2024, 10:50am UTC](https://community.sendbird.com/t/android-crash-sendbirdchat-instance-hasnt-been-initialized/9257/5 "2024-12-18T10:50:00Z")

</div>

I have also seen similar issue in my Crashlytics.  
The crash only happened on Samsung devices (`Samsung Galaxy A03s`, `Samsung Galaxy Note 20` and couple of more Samsung devices).  
I can’t reproduce it on my Pixel 6a.

```auto
java.lang.RuntimeException: SendbirdChat.init() should be called with returning true prior to connect().
	at com.sendbird.android.SendbirdChat.connect(SendbirdChat.kt:792)
	at com.sendbird.android.SendbirdChat.connect(SendbirdChat.kt:767)
	at com.rogerthat.rogerapp.view.login.LoginVM.setupSendBirdAndGotoNextScreen(LoginVM.kt:399)
	at com.rogerthat.rogerapp.view.login.LoginVM.access$setupSendBirdAndGotoNextScreen(LoginVM.kt:44)
	at com.rogerthat.rogerapp.view.login.LoginVM$showTermsDialogOrGetFirebaseToken$2.invoke(LoginVM.kt:392)
	at com.rogerthat.rogerapp.view.login.LoginVM$showTermsDialogOrGetFirebaseToken$2.invoke(LoginVM.kt:392)
	at com.rogerthat.rogerapp.view.login.LoginVM.showTermsDialogOrGetFirebaseToken$lambda$9(LoginVM.kt:392)
	at com.rogerthat.rogerapp.view.login.LoginVM.$r8$lambda$d_VvhDnv_KqeOrWEVz98zTSYB0M(Unknown Source:0)
	at com.rogerthat.rogerapp.view.login.LoginVM$$ExternalSyntheticLambda1.onSuccess(D8$$SyntheticClass:0)
	at com.google.android.gms.tasks.zzm.run(com.google.android.gms:play-services-tasks@@18.1.0:1)
	at android.os.Handler.handleCallback(Handler.java:942)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loopOnce(Looper.java:226)
	at android.os.Looper.loop(Looper.java:313)
	at android.app.ActivityThread.main(ActivityThread.java:8762)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:604)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)

```

sendbirdChat = “4.15.2”  
sendbirdUiKit = “3.13.0”  
Definitely I will be going to update libraries and do a release incase it fix the issue. After that I will update here.

Currently in my application class I call `SendbirdUIKit.init()` and after user login I call `SendbirdChat.connect()` and the app crashes on method `connect()`.
