function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Swaminathan V 2Swaminathan V 2 

App crash in Live Agent chat for android

We are implementing the salesforce live agent chat in our android mobile application. Everything works fine. But we have a corner case.
Initiating the chat -> Opens chat window -> click on close button in window immediately [ within fraction of second ]. App will be crashed. Below is the log obtained from crash.

java.lang.NullPointerException: Session is not active. Unable to create LiveAgent Request. at com.salesforce.android.service.common.utilities.validation.Arguments.checkNotNull(Arguments.java:75) at com.salesforce.android.chat.core.internal.liveagent.request.InternalChatRequestFactory.checkSessionIsActive(InternalChatRequestFactory.java:104) at com.salesforce.android.chat.core.internal.liveagent.request.InternalChatRequestFactory.createEndRequest(InternalChatRequestFactory.java:95) at com.salesforce.android.chat.core.internal.liveagent.handler.EndHandler.onEndingSessionState(EndHandler.java:109) at com.salesforce.android.chat.core.internal.liveagent.LiveAgentChatSession.onStateChanged(LiveAgentChatSession.java:177) at com.salesforce.android.chat.core.internal.liveagent.LiveAgentChatSession.onStateChanged(LiveAgentChatSession.java:54) at com.salesforce.android.service.common.utilities.lifecycle.LifecycleEvaluator.stateChanged(LifecycleEvaluator.java:304) at com.salesforce.android.service.common.utilities.lifecycle.LifecycleStateWatcher$1.run(LifecycleStateWatcher.java:73) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6688) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)

is there any method to overcome this issue. Any help appreciated.
Steve ThistleSteve Thistle
Hi Swaminathan,

Suggest you post your question on the official Salesforce Snap-Ins for Mobile community. The members there develop with or are the developers of the Service Sdk. They should be able to provide a prompt response and help you with the issue.

https://plus.google.com/communities/104189600084591024148/stream/2cb9f7c2-1953-40f1-b94b-734ab703ca58

Steve
Evan IsnorEvan Isnor
Hey! I can answer this here. This is a known edge case that has been fixed for our upcoming release; unfortunately there is no workaround in the interim. We'll be publishing the next version of Snap-Ins Chat for Android on June 8th, so your issue should be resolved after you upgrade. If you experience any further issues please don't hesitate to get in touch with us on our Google Plus community as mentioned previously by Steve. We'll do our best to get back to you as soon as we can.

Cheers!
Evan
Snap-Ins Mobile for Android