Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nfonjeannoel opened this issue Aug 14, 2024 · 3 comments

Comments

@nfonjeannoel
Copy link

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.

@jom16antonio
Copy link

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

@Doc1faux
Copy link
Collaborator

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 :)

@nfonjeannoel
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants