Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Android Build a Blog Reader Android App Adapting Data for Display in a List Filling Our String Array and Creating the Adapter

JSONException: Unterminated string

When I try to run the app with the NUMBER_OF_POSTS set to 20, I get the following exception:

org.json.JSONException: Unterminated string at character 5822 ... (Shortened) ... "title":"New Courses: Node JS Basics & Re

It appears to me that perhaps the String type isn't long enough to hold that much data since it doesn't break when the NUMBER_OF_POSTS is a lesser value, but why is it that Ben can run this program just fine?

1 Answer

Harry James
Harry James
14,780 Points

Hey David!

Take a look at Hubert Maraszek's fix for this over here!

A lot of users have had this issue but, his fix seems to have worked for everyone so far :)

If it helps you, be sure to give him a Vote up on the page!

Hope it helps :)