Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Build a Weather App (2015) Working with JSON Introducing JSONObject

pranav kakkad
pranav kakkad
755 Points

cannot be converted to JSONObject

04-02 15:01:58.366 8601-8793/com.example.pranav.stormy E/MainActivity: Exception Caught: org.json.JSONException: Value okhttp3.internal.http.RealResponseBody@54241aa of type java.lang.String cannot be converted to JSONObject at org.json.JSON.typeMismatch(JSON.java:111) at org.json.JSONObject.<init>(JSONObject.java:160) at org.json.JSONObject.<init>(JSONObject.java:173) at com.example.pranav.stormy.MainActivity.getCurrentDetails(MainActivity.java:82) at com.example.pranav.stormy.MainActivity.access$100(MainActivity.java:24) at com.example.pranav.stormy.MainActivity$1.onResponse(MainActivity.java:57) at okhttp3.RealCall$AsyncCall.execute(RealCall.java:135) at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) at java.lang.Thread.run(Thread.java:818)

I am not able to detect error Can anyone help me out