0

I have the following for debug purposes:

debug {
    minifyEnabled true
    shrinkResources true
    proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}

I have a class MyClass, and I'm using Gson to convert it to JSON before sending it to my server. While I expect the JSON to be {"name":"blah", "age": 40}, the server receives it as {"a":"blah", "b": 40}. I tried several things in the proguard rule files but to no avail. Here is an example of my latest try:

-keep public class com.package.package.MyClass { *; }

What am I missing? Thanks

MurugananthamS
  • 2,395
  • 4
  • 20
  • 49
Amos
  • 1,321
  • 2
  • 23
  • 44

1 Answers1

0

Have you tried serialization annotation

@SerializedName("name")
String name ="";
Traendy
  • 1,423
  • 15
  • 17