Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ArrayIndexOutOfBoundsException crash from SDK when DP3T.sendIAmInfected() is called

See original GitHub issue

ArrayIndexOutOfBoundsException crash from SDK when DP3T.sendIAmInfected() is called. SDK: DP-3T SDK 1.0.0 GAEN: v1.3.1

I have an Android DP-3T related crash I am getting intermittently.

I do a clean install of our app. It uses the 1.0.0 DP-3T SDK and play-services-nearby-18.0.2-eap-v1.3.1.aar I give all the permissions and GAEN works on this device. After our onboarding flow GAEN activates (Settings -> Google -> COVID-19 submenu also confirms this)

Immediately after install, I start our infection confirmation flow. In the flow as a user, I enter the onsetDate as today’s date. After our app has confirmed with our backend that I am allowed to confirm my infection then our app calls the DP-3T SDK:

DP3T.sendIAmInfected(activity, onsetDate, ...

DP-3T SDK crashes with

java.lang.ArrayIndexOutOfBoundsException: length=0; index=0 at$Gson$Types.getGenericSupertype($Gson$ at$Gson$Types.getSupertype($Gson$ at$Gson$Types.getCollectionElementType($Gson$ at at at at at at at at at at$1.onSuccess( at$1.onSuccess( at$1.onResponse( at retrofit2.DefaultCallAdapterFactory$ExecutorCallbackCall$1.lambda$onResponse$0$DefaultCallAdapterFactory$ExecutorCallbackCall$1( at retrofit2.-$$Lambda$DefaultCallAdapterFactory$ExecutorCallbackCall$1$ Source:6) at android.os.Handler.handleCallback( at android.os.Handler.dispatchMessage( at android.os.Looper.loop( at at java.lang.reflect.Method.invoke(Native Method) at$ at

from the line PendingKeyUploadStorage.getInstance(activity).addPendingKey(delayedKey); inside the public void onSuccess(String authToken) callback. As nobody will catch the Exception then our whole app also crashes.

So IMHO two issues here:

  1. The crash itself
  2. That the code running in the callback should also handle unexpected errors better and not crash the app, but just give a failure callback to the app.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

fbzlicommented, Jul 9, 2020

Any chance you have Proguard enabled? I can only reproduce this with obfuscation enabled specifically.

The PendingKey model appears to be in the wrong package/class, thus is not protected by the proguard exemption rules. We’re going to fix that.

fbzlicommented, Jul 10, 2020

I pushed a fix. That should work with any Proguard configuration and/or core library desugaring enabled.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found