amplitude / experiment-android-client

MIT License
4 stars 2 forks source link

Proguard Rules + Kotlin Serialization #51

Closed ppetarr closed 2 weeks ago

ppetarr commented 7 months ago

This is more of FYI than an open issue, but I spent too long on this problem.

If the client doesn't use kotlinx.serialization then in release these types of problems will come up

Error decoding JSON: Serializer for class 'EvaluationFlag' is not found.
Mark the class as @Serializable or provide the serializer explicitly.

We don't use kotlinx.serialization but seeing as the library does, we needed to add proguard rules to stop the classes from being obfuscated during run-time for our release builds. You can find the rules here.

Might be worth adding this note to your documentation + the rules for such cases.

nico-gonzalez commented 7 months ago

Hello! we are facing the same issue. It looks like this change introduced kotlinx.serialization but no proguard rules were added nor published by the library. It looks like this started in v1.11.0. I agree with @ppetarr this should either be included by the SDK itself or add the required proguard rules in the docs. Thanks!

bgiori commented 3 weeks ago

This should be fixed in 1.12.2