crisp-sdk-android icon indicating copy to clipboard operation
crisp-sdk-android copied to clipboard

Fatal Exception: java.lang.AssertionError: Crisp ChatBox SDK has not been configured yet. Please make sure to call Crisp.configure(String websiteID) first!

Open nfonjeannoel opened this issue 1 year ago • 3 comments
trafficstars

I have been getting a few crash logs from firebase analytics. I have not been able to reproduce this crash, so don't know what is causing the crash. Yes I have Crisp.configure(this, BuildConfig.CRISP_WEBSITE_ID) in my launch activity.

Fatal Exception: java.lang.AssertionError Crisp ChatBox SDK has not been configured yet. Please make sure to call Crisp.configure(String websiteID) first!

full crash logs Fatal Exception: java.lang.AssertionError: Crisp ChatBox SDK has not been configured yet. Please make sure to call Crisp.configure(String websiteID) first! at org.junit.Assert.fail(Assert.java:89) at org.junit.Assert.assertTrue(Assert.java:42) at org.junit.Assert.assertNotNull(Assert.java:713) at im.crisp.client.ChatActivity.onCreate(SourceFile:70) at android.app.Activity.performCreate(Activity.java:8547) at android.app.Activity.performCreate(Activity.java:8511) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1437) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3877) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4042) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2436) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:211) at android.os.Looper.loop(Looper.java:300) at android.app.ActivityThread.main(ActivityThread.java:8324) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:581) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1028)

My thoughts. Must Crisp.configure be called in the same activity that host the fragment where crisp chat needs to be configured?

presently, I can Crisp.configure( in a activity called when the app launches but I instantiate Crisp chat in the activity that hosts the chat. Could this be the issue? can't test because I have actually not been able to reproduce this crash, but I see if from firebase analytics.

nfonjeannoel avatar Aug 14 '24 22:08 nfonjeannoel

It would be better to put the configuration function call in your Application class.

jom16antonio avatar Aug 27 '24 00:08 jom16antonio

Hi @nfonjeannoel thank you for your feedback and sorry for my late reply...

What version of the SDK are you using? Since v1.0.14, the SDK should just silently fail, close the ChatActivity and log the AssertionError you have instead of throwing it.

Crisp.configure should at least be called once per App Lifecycle before launching the ChatActivity no matter where you do it, calling it from the Application.onCreate() method is just a convenient way to ensure it is set at the beginning of the App Lifecycle if you use only one website.

Hope this could help you :)

Doc1faux avatar Aug 29 '24 09:08 Doc1faux

Using v1.0.13 @Doc1faux Thank you. WIll update to latest version then

nfonjeannoel avatar Sep 01 '24 14:09 nfonjeannoel

This issue is stale for more than 90 days, I close it.

Doc1faux avatar Sep 18 '25 16:09 Doc1faux