I\'m writing an Android app need using gson to deserialize the json string:
{
\"reply_code\": 001,
\"userinfo\": {
\"username\": \"002\",
You have ProGuard enabled in your release
build type - minifyEnabled true
. It obfuscates the code by changing class/variable names.
You should annotate your class properties, so Gson knows what to look for:
public class ReturnData {
@SerializedName("reply_code")
public String reply_code;
@SerializedName("userinfo")
public userinfo userinfo;
}
public class userinfo {
@SerializedName("username")
public String username;
@SerializedName("userip")
public String userip;
}
This way Gson won't look at the properties' names, but will look at @SerializedName
annotation.