Answered

Intermittent Android SDK crashing when Intercom is experiencing downtime.

  • 5 July 2022
  • 1 reply
  • 75 views

The Intercom servers went down on June 6 causing multiple crashes of our app. The advice from Intercom at the time was to upgrade to 12.4.1, which we did and this solved the issue until today, when the server went down again (as per intercomstatus.com) and our app had multiple crashes. 

 

The crashes being caused when the intercom log event is triggered in our app. Intercom.client().logEvent

Please advise on the solution. 

 

Our crashlytics shows the following crash data :

ErrorStringExtractor.kt line 8

io.intercom.android.sdk.api.ErrorStringExtractorKt.extractErrorString 

Fatal Exception: com.google.gson.JsonSyntaxException: Expected a com.google.gson.JsonObject but was com.google.gson.JsonPrimitive

       at com.google.gson.internal.bind.TypeAdapters$33$1.read(TypeAdapters.java:869)

       at com.google.gson.Gson.fromJson(Gson.java:963)

       at com.google.gson.Gson.fromJson(Gson.java:928)

       at com.google.gson.Gson.fromJson(Gson.java:877)

       at com.google.gson.Gson.fromJson(Gson.java:848)

       at io.intercom.android.sdk.api.ErrorStringExtractorKt.extractErrorString(ErrorStringExtractor.kt:8)

       at io.intercom.android.sdk.api.Api$1.onError(Api.java:225)

       at io.intercom.android.sdk.api.BaseCallback.handleError(BaseCallback.java:43)

       at io.intercom.android.sdk.api.BaseCallback.onResponse(BaseCallback.java:28)

       at retrofit2.DefaultCallAdapterFactory$ExecutorCallbackCall$1.lambda$onResponse$0(DefaultCallAdapterFactory.java:89)

       at retrofit2.DefaultCallAdapterFactory$ExecutorCallbackCall$1.$r8$lambda$hVGjmafRi6VitDIrPNdoFizVAdk(DefaultCallAdapterFactory.java)

       at retrofit2.DefaultCallAdapterFactory$ExecutorCallbackCall$1$$InternalSyntheticLambda$0$daf5173ad73a9dc0e8131143f299c222e2ca4cddd7cb10b2d0a6e331a0602ae1$0.run(DefaultCallAdapterFactory.java:6)

       at android.os.Handler.handleCallback(Handler.java:938)

       at android.os.Handler.dispatchMessage(Handler.java:99)

       at android.os.Looper.loop(Looper.java:264)

       at android.app.ActivityThread.main(ActivityThread.java:8312)

       at java.lang.reflect.Method.invoke(Method.java)

       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:632)

       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1049)

 

icon

Best answer by Evan P 7 July 2022, 11:25

View original

1 reply

Hey @mike c​, 👋 thanks for reaching out! I'm one of the Support Engineers here @ Intercom! 👍

 

Thanks for sharing these details, it is really helpful. The root cause here was our Android SDK not gracefully handling a specific kind of failure for an Intercom API call, resulting in a crash.

 

While you were encouraged to upgrade to version "12.4.1", I will ask if it's possible for you to upgrade to the latest version "12.4.2". I can confirm the latest version of the Android SDK (12.4.2) has been made robust against these failures.

 

I hope this clarifies, please let me know if you have any questions.

Reply