Model to serialize:
data class Settings(
@SerializedName("custom_field_name_1")
val field1: Int,
@SerializedName("custom_field_name_2")
val field2: Int,
...
Code to serialize:
gson.toJson(settings).also {
Log.i("TEST", "settingsToJson $it")
}
In release build (with minifyEnabled): I get:
settingsToJson {"a":7,"b":0,"c":0,"d":"{"a":8,"b":30}","e":10,"f":1.0,"g":false,"h":1,"i":1,"j":5,"k":0,"l":false,"m":0.0}
How can I fix it?
It seems it works only for deserialization (json string to Object) but not otherwise