Synerise / android-sdk

Synerise SDK for Android
9 stars 8 forks source link

`JsonIOException` when calling `getDocument` in 5.18.0 #14

Closed ikurek closed 3 months ago

ikurek commented 4 months ago

We have encountered an error after updating to 5.18.0. When Content.getDocument(String) call is executed, Synerise SDK invokes onFailureListener with ApiError wrapping GSON exception:

com.google.gson.JsonIOException: Abstract classes can't be instantiated! Register an InstanceCreator or a TypeAdapter for this type. Class name: com.synerise.sdk.a118

I'm unable to investigate further, since SDK source is not available, but the same call is executed correctly in SDK versions 5.17.0 and earlier.

konned commented 4 months ago

Nothing has changed regarding Content module between those versions. I will take a look at it. Are you encountering this problem on every call?

ikurek commented 4 months ago

As far as I can tell, yes - I've tested a few and they all seem to fail on 5.18.0 and work on 5.17.0

konned commented 4 months ago

Try adding: android.enableR8.fullMode=false to your gradle.properties.

ikurek commented 4 months ago

We already have that property set to false 😞

konned commented 4 months ago

Do you have this in proguard rules:

-keep class * {
  @com.google.gson.annotations.SerializedName <fields>;
} 

?

ikurek commented 4 months ago

I've tried it, without any luck - the error still persists and I still see Class name: com.synerise.sdk.a118 in the error log 🤔

konned commented 3 months ago

Issue was solved in 5.18.1