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 Working with JSON Introducing JSONObject

Hazel Pan
Hazel Pan
3,510 Points

AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher

My logcat shows the logs like these :

2019-01-17 16:58:43.268 27325-27347/com.example.stormy E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher Process: com.example.stormy, PID: 27325 java.lang.IllegalStateException: closed at okio.RealBufferedSource.rangeEquals(RealBufferedSource.java:407) at okio.RealBufferedSource.rangeEquals(RealBufferedSource.java:401) at okhttp3.internal.Util.bomAwareCharset(Util.java:471) at okhttp3.ResponseBody.string(ResponseBody.java:175) at com.example.stormy.MainActivity$1.onResponse(MainActivity.java:56) at okhttp3.RealCall$AsyncCall.execute(RealCall.java:206) at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:764) 2019-01-17 16:58:43.336 27325-27347/com.example.stormy I/Process: Sending signal. PID: 27325 SIG: 9

Is it something wrong with OkHttp?

1 Answer

Posting your code would help :)