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

  • SEARCH
  • Home
  • 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 7791347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:51:31+00:00 2026-06-01T21:51:31+00:00

I sometimes have problems with the Gson().fromJSON function… My app deserialize a JSON string

  • 0

I sometimes have problems with the Gson().fromJSON function… My app deserialize a JSON string using Gson() and it works almost all the time perfectly, but several times I get this error:

com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Expected literal value at line 1 column 7592
at com.google.gson.Gson.fromJson(Gson.java:769)
at com.google.gson.Gson.fromJson(Gson.java:721)
at com.google.gson.Gson.fromJson(Gson.java:670)
at com.google.gson.Gson.fromJson(Gson.java:642)
at my.new.prog.Main$GetData.onPostExecute(Main.java:301)
at my.new.prog.Main$GetData.onPostExecute(Main.java:1)
at android.os.AsyncTask.finish(AsyncTask.java:417)
at android.os.AsyncTask.access$300(AsyncTask.java:127)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:429)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3691)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)
at dalvik.system.NativeStart.main(Native Method)
Caused by: com.google.gson.stream.MalformedJsonException: Expected literal value at line 1 column 7592
at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1298)
at com.google.gson.stream.JsonReader.readLiteral(JsonReader.java:1195)
at com.google.gson.stream.JsonReader.nextValue(JsonReader.java:789)
at com.google.gson.stream.JsonReader.objectValue(JsonReader.java:766)
at com.google.gson.stream.JsonReader.peek(JsonReader.java:380)
at com.google.gson.stream.JsonReader.advance(JsonReader.java:426)
at com.google.gson.stream.JsonReader.skipValue(JsonReader.java:637)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:174)
at com.google.gson.Gson.fromJson(Gson.java:755)
... 16 more

I think that this error appears when the connection fails just a lil bit and it retrieve a corrupted JSON String. I repeat that this error appears randomly and in different parts of the JSON string.

In this case I’m getting the error here: Expected literal value at line 1 column 7592
But sometimes I get the error here: Expected literal value at line 1 column 140

What do you think? Could be that the problem I’m having is caused by a corrupted JSON string?

Thank you in advance!

  • 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-06-01T21:51:33+00:00Added an answer on June 1, 2026 at 9:51 pm

    I think that the problem is caused by interrupted connection. This is totally certain if the exception shows for the same json string. Otherwise there is small possibility that from time to time you generate really malformed json files.

    If the problem is with connection being broken, consider retrying until you get rid of this exception. If the file is big, you might find the resumable download thread helpful. However, if the file size is small I wouldn’t advise you to go as complex as that.

    PS: I never had such inconsistent behavior from GSON, so I think it is not a problem in the library itself, if that is what you think.

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

Sidebar

Related Questions

I have problems with UserPrincipal.GetGroups() and GetAuthorizationGroups() method. Sometimes it works, sometimes not. The
I have problems with a specific query when using the sqlite3_step function: SELECT DISTINCT
I have problems with class loaders. Sometimes it works, sometimes it doesn't work. When
I have problems running my GWT app in debug mode using maven 3. Hosted
I have some problems with Eclipse: Sometimes I write the code and compile it
I have problems analyzing my crashlog. The iPhone crashes sometimes, when I click on
I am embedding JRuby using Red Bridge into an app and seem to have
After upgrading to the newest GWT/Google app engine I have problems opening my workspace
sometimes i have problems with the debug. I have a solution with some projects
I have a problem in a site that I am trying to develop Sometimes

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.