Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 862757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T09:11:48+00:00 2026-05-15T09:11:48+00:00

I’m relatively new to java and android development so sorry if this is a

  • 0

I’m relatively new to java and android development so sorry if this is a silly question. I’m building simple app, simply to learn the android ropes, that will display a list of the most recent photos uploaded to flickr. The app is constructed but it’s crapping out when it tries to deserialize the json that I get back from flickr. Here is my error:

06-23 21:11:25.560: WARN/System.err(298): com.google.gson.JsonParseException: The JsonDeserializer com.google.gson.DefaultTypeAdapters$CollectionTypeAdapter@43e28168 failed to deserialized json object {"page":1,"pages":100,"perpage":10,"total":1000,"photo":[{"id":"4728507833","owner":"59492791@N00","secret":"496b96968d","server":"1407","farm":2,"title":"DSCN2733","ispublic":1,"isfriend":0,"isfamily":0,"url_sq":"http://farm2.static.flickr.com/1407/4728507833_496b96968d_s.jpg","height_sq":75,"width_sq":75},{"id":"4728507883","owner":"30728507@N07","secret":"ab80a5bdf4","server":"1194","farm":2,"title":"Sultan","ispublic":1,"isfriend":0,"isfamily":0,"url_sq":"http://farm2.static.flickr.com/1194/4728507883_ab80a5bdf4_s.jpg","height_sq":75,"width_sq":75},{"id":"4728507955","owner":"30311414@N00","secret":"7d6ea1cd08","server":"1377","farm":2,"title":"DSC04455","ispublic":1,"isfriend":0,"isfamily":0,"url_sq":"http://farm2.static.flickr.com/1377/4728507955_7d6ea1cd08_s.jpg","height_sq":75,"width_sq":75},{"id":"4728507979","owner":"24737003@N04","secret":"c76cfe4afb","server":"1162","farm":2,"title":"IMGP1429","ispublic":1,"isfriend":0,"isfamily":0,"url_sq":"http://farm2.static.flickr.com/1162/4728507979_c76cfe4afb_s.jpg","height_sq":75,"width_sq":75},{"id":"4728508009","owner":"62084706@N00","secret":"76b858efe7","server":"1366","farm":2,"title":"DSC_2459.JPG","ispublic":1,"isfriend":0,"isfamily":0,"url_sq":"http://farm2.static.flickr.com/1366/4728508009_76b858efe7_s.jpg","height_sq":75,"width_sq":75},{"id":"4729153856","owner":"50879555@N02","secret":"843d4f56ec","server":"1129","farm":2,"title":"IMG_1585","ispublic":1,"isfriend":0,"isfamily":0,"url_sq":"http://farm2.static.flickr.com/1129/4729153856_843d4f56ec_s.jpg","height_sq":75,"width_sq":75},{"id":"4729153942","owner":"43941986@N08","secret":"f7ea2d3037","server":"1257","farm":2,"title":"IMG_1126","ispublic":1,"isfriend":0,"isfamily":0,"url_sq":"http://farm2.static.flickr.com/1257/4729153942_f7ea2d3037_s.jpg","height_sq":75,"width_sq":75},{"id":"4729153952","owner":"50634775@N07","secret":"af6d937dcd","server":"1129","farm":2,"title":"069_69","ispublic":1,"isfriend":0,"isfamily":0,"url_sq":"http://farm2.static.flickr.com/1129/4729153952_af6d937dcd_s.jpg","height_sq":75,"width_sq":75},{"id":"4729153962","owner":"34771042@N07","secret":"71f6c321eb","server":"1014","farm":2,"title":"Snapshot_010","ispublic":1,"isfriend":0,"isfamily":0,"url_sq":"http://farm2.static.flickr.com/1014/4729153962_71f6c321eb_s.jpg","height_sq":75,"width_sq":75},{"id":"4729153964","owner":"14318596@N08","secret":"6ab627b565","server":"1364","farm":2,"title":"DSC_0679","ispublic":1,"isfriend":0,"isfamily":0,"url_sq":"http://farm2.static.flickr.com/1364/4729153964_6ab627b565_s.jpg","height_sq":75,"width_sq":75}]} given the type com.google.gson.ParameterizedTypeImpl@3dd03b7
06-23 21:11:25.580: WARN/System.err(298):     at com.google.gson.JsonDeserializerExceptionWrapper.deserialize(JsonDeserializerExceptionWrapper.java:63)
06-23 21:11:25.580: WARN/System.err(298):     at com.google.gson.JsonDeserializationVisitor.invokeCustomDeserializer(JsonDeserializationVisitor.java:88)
06-23 21:11:25.600: WARN/System.err(298):     at com.google.gson.JsonObjectDeserializationVisitor.visitFieldUsingCustomHandler(JsonObjectDeserializationVisitor.java:117)
06-23 21:11:25.600: WARN/System.err(298):     at com.google.gson.ObjectNavigator.navigateClassFields(ObjectNavigator.java:150)
06-23 21:11:25.610: WARN/System.err(298):     at com.google.gson.ObjectNavigator.accept(ObjectNavigator.java:123)
...
06-23 21:11:25.851: WARN/System.err(298): Caused by: java.lang.IllegalStateException: This is not a JSON Array.
06-23 21:11:25.901: WARN/System.err(298):     at com.google.gson.JsonElement.getAsJsonArray(JsonElement.java:100)
06-23 21:11:25.911: WARN/System.err(298):     at com.google.gson.DefaultTypeAdapters$CollectionTypeAdapter.deserialize(DefaultTypeAdapters.java:468)
06-23 21:11:25.921: WARN/System.err(298):     at com.google.gson.DefaultTypeAdapters$CollectionTypeAdapter.deserialize(DefaultTypeAdapters.java:435)
06-23 21:11:25.921: WARN/System.err(298):     at com.google.gson.JsonDeserializerExceptionWrapper.deserialize(JsonDeserializerExceptionWrapper.java:50)
06-23 21:11:25.931: WARN/System.err(298):     ... 26 more

From, the error I’m assuming it has something GSON doesn’t like about the json that is being returned but I don’t know enough about how java converts objects and other types of variables during the whole operation.

I’m not sure if you will need this but here is some of the code from the project:

String response = client.getResponse();
response = response.replace("jsonFlickrApi(", "");
response = response.substring(0,response.length()-2);
Gson gson = new Gson();

FlickrPhotos flickrphotos = new FlickrPhotos();
try {
    flickrphotos = gson.fromJson(response, FlickrPhotos.class);
} catch(Exception e) {
    e.printStackTrace();
}

Here is FlickrPhotos:

public class FlickrPhotos {
    private String page, pages, perpage, total;
    private List<FlickrPhoto> photos;

    public List<FlickrPhoto> getPhotos() {
        return photos;
    }
    // More getters
}

Here is FlickrPhoto:

public class FlickrPhoto {
    private String id, owner, secret, server, title, width_sq, url_sq;
    // getters
}

Any ideas? Thanks so much for your time and probably patience…(If I’m noobing it up!)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T09:11:48+00:00Added an answer on May 15, 2026 at 9:11 am

    One thing that stood out to me by just looking was this photo vs photos discrepancy:

    ... "total":1000,"photo":[{ ...
    

    vs

    private List<FlickrPhoto> photos;
    
    public List<FlickrPhoto> getPhotos() {
        return photos;
    }
    

    If you haven’t already, maybe try renaming your List to just photo instead?

    Also, many of the properties (page, pages, perpage, width_sq etc) aren’t Strings in the JSON. I would think there’s an automatic type converter that deals with that, but you might as well declare those as ints.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 468k
  • Answers 468k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The "tailing" slash at the end is escaping the double… May 16, 2026 at 2:28 am
  • Editorial Team
    Editorial Team added an answer You can subclass the ABC (abstract base class) collections.Mapping (or… May 16, 2026 at 2:28 am
  • Editorial Team
    Editorial Team added an answer Because GET and POST do not have the same semantic… May 16, 2026 at 2:28 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.