-
Notifications
You must be signed in to change notification settings - Fork 90
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
ArrayIndexOutOfBoundsException crash from SDK when DP3T.sendIAmInfected() is called #173
Comments
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. |
Hei! Same with our application. We are planning to use Proguard or R8 for our release, but this has not been correctly configured yet. I am trying to reproduce this today myself, and have no luck thus far. |
Correction: I can also reproduce this with a release (not debug) build using |
Btw, we are using
I am starting to doubt myself now. Maybe I was on release then. Sorry about that. |
I pushed a fix. That should work with any Proguard configuration and/or core library desugaring enabled. |
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 com.google.gson.internal.$Gson$Types.getGenericSupertype($Gson$Types.java:248)
at com.google.gson.internal.$Gson$Types.getSupertype($Gson$Types.java:284)
at com.google.gson.internal.$Gson$Types.getCollectionElementType($Gson$Types.java:302)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory.create(CollectionTypeAdapterFactory.java:52)
at com.google.gson.Gson.getAdapter(Gson.java:458)
at com.google.gson.Gson.fromJson(Gson.java:926)
at com.google.gson.Gson.fromJson(Gson.java:892)
at com.google.gson.Gson.fromJson(Gson.java:841)
at com.google.gson.Gson.fromJson(Gson.java:813)
at org.dpppt.android.sdk.internal.util.Json.fromJson(Json.java:34)
at org.dpppt.android.sdk.internal.PendingKeyUploadStorage.getPendingKeys(PendingKeyUploadStorage.java:53)
at org.dpppt.android.sdk.internal.PendingKeyUploadStorage.addPendingKey(PendingKeyUploadStorage.java:85)
at org.dpppt.android.sdk.DP3T$1.onSuccess(DP3T.java:277)
at org.dpppt.android.sdk.DP3T$1.onSuccess(DP3T.java:269)
at org.dpppt.android.sdk.internal.backend.BackendReportRepository$1.onResponse(BackendReportRepository.java:54)
at retrofit2.DefaultCallAdapterFactory$ExecutorCallbackCall$1.lambda$onResponse$0$DefaultCallAdapterFactory$ExecutorCallbackCall$1(DefaultCallAdapterFactory.java:89)
at retrofit2.-$$Lambda$DefaultCallAdapterFactory$ExecutorCallbackCall$1$3wC8FyV4pyjrzrYL5U0mlYiviZw.run(Unknown Source:6)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
from the line
PendingKeyUploadStorage.getInstance(activity).addPendingKey(delayedKey);
inside thepublic void onSuccess(String authToken)
callback.As nobody will catch the Exception then our whole app also crashes.
So IMHO two issues here:
The text was updated successfully, but these errors were encountered: