GSON JsonObject "Unsupported Operation Exception: null" getAsString
Maybe your JsonElement
is a JsonNull
What you could do is to first check that it isn't by using json.isJsonNull
Otherwise, try to get its String representation with json.toString
I had a similar problem and I had to change jsonObject.getAsString()
to jsonObject.toString();