The fact is that sometimes web developers clumsily write json as a result it turns out that for 1 element there is a valid "data" parameter, and for 2 there is no result when using GSON an application crashes. Is there a way to skip if gson can't get the data?

Here Android Studio swears writes Cannot resolve symbol 'PhotosUrls'

@SerializedName("photosUrls") public List<PhotosUrls> photosUrls; 

This is json

  "photosUrls":[ "https://buzzar.s3-us-west-1.amazonaws.com/v1.0/public/images/1481001023663-78155.jpg" ] 
  • So, like, should not crash ... Try something like this: Gson gson = new GsonBuilder().serializeNulls().create(); - Yuriy SPb
  • tried it does not work. In Gson, 3 items in the list work and crashes on 4. In Json, all the rules. - Andro
  • “Expected BEGIN_OBJECT but was STRING at line 1 column 1” here is the error - Andro
  • Well ... Show data and model for them and how to parse - YuriySPb
  • @ YuriySPb, added text - Andro

1 answer 1

The answer looks like this List photosUrls