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 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 :)