ihsanbal/LoggingInterceptor

NetworkOnMainThreadException error

Closed this issue · 0 comments

If loggable is only false I get an error
Process: com.mimoza.photolift, PID: 30503 android.os.NetworkOnMainThreadException at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1448) at java.net.SocketInputStream.read(SocketInputStream.java:169) at java.net.SocketInputStream.read(SocketInputStream.java:139) at okio.Okio$2.read(Okio.java:140) at okio.AsyncTimeout$2.read(AsyncTimeout.java:237) at okio.RealBufferedSource.read(RealBufferedSource.java:51) at okhttp3.internal.http1.Http1ExchangeCodec$AbstractSource.read(Http1ExchangeCodec.java:389) at okhttp3.internal.http1.Http1ExchangeCodec$ChunkedSource.read(Http1ExchangeCodec.java:475) at okhttp3.internal.connection.Exchange$ResponseBodySource.read(Exchange.java:286) at okio.Buffer.writeAll(Buffer.java:1143) at okio.RealBufferedSource.readString(RealBufferedSource.java:203) at okhttp3.ResponseBody.string(ResponseBody.java:182) at com.mimoza.photolift.Splash$onCreate$1.OnSuccess(Splash.kt:34) at com.teknasyon.ares.network.NetworkFactory$callInit$1.OnSuccess(NetworkFactory.kt:284) at com.teknasyon.ares.network.NetworkFactory.handleApiCallResponse(NetworkFactory.kt:351) at com.teknasyon.ares.network.NetworkFactory.access$handleApiCallResponse(NetworkFactory.kt:39) at com.teknasyon.ares.network.NetworkFactory$callRequest$1$onResponse$1.invokeSuspend(NetworkFactory.kt:340) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask$DefaultImpls.run(Dispatched.kt:235) at kotlinx.coroutines.DispatchedContinuation.run(Dispatched.kt:81) at android.os.Handler.handleCallback(Handler.java:789) at android.os.Handler.dispatchMessage(Handler.java:98) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6710) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:770) Suppressed: android.os.NetworkOnMainThreadException at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1448) at java.net.SocketInputStream.read(SocketInputStream.java:169) at java.net.SocketInputStream.read(SocketInputStream.java:139) at okio.Okio$2.read(Okio.java:140) at okio.AsyncTimeout$2.read(AsyncTimeout.java:237) at okio.RealBufferedSource.read(RealBufferedSource.java:51) at okhttp3.internal.http1.Http1ExchangeCodec$AbstractSource.read(Http1ExchangeCodec.java:389) at okhttp3.internal.http1.Http1ExchangeCodec$ChunkedSource.read(Http1ExchangeCodec.java:475) at okhttp3.internal.Util.skipAll(Util.java:204) at okhttp3.internal.Util.discard(Util.java:186) at okhttp3.internal.http1.Http1ExchangeCodec$ChunkedSource.close(Http1ExchangeCodec.java:511) at okio.ForwardingSource.close(ForwardingSource.java:43) at okhttp3.internal.connection.Exchange$ResponseBodySource.close(Exchange.java:313) at okio.RealBufferedSource.close(RealBufferedSource.java:476) at okhttp3.ResponseBody.$closeResource(ResponseBody.java:137) at okhttp3.ResponseBody.string(ResponseBody.java:183) ... 15 more