android.os.NetworkOnMainThreadException

Stack Overflow | Abhriya Roy | 9 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    exception when trying to retrieve user's friends

    Stack Overflow | 3 years ago | Michael Arenzon
    android.os.NetworkOnMainThreadException
  2. 0

    Implicit Call cancels for SPDY/3 & HTTP/2 connections can perform network I/O.

    GitHub | 2 years ago | JakeWharton
    java.lang.IllegalStateException: Fatal Exception thrown on Scheduler.Worker thread.
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Android Crash - NetworkOnMainThreadException

    GitHub | 2 years ago | bFlood
    java.lang.RuntimeException: Unable to destroy activity {com.sdlportal.sdlmobile3/com.eclipsesource.tabris.android.TabrisActivity}: android.os.NetworkOnMainThreadException
  5. 0

    NetworkOnMainThread RxJava + Retrofit + Lollipop+

    Stack Overflow | 2 years ago | Robert Estivill
    java.lang.IllegalStateException: Fatal Exception thrown on Scheduler.Worker thread.
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. android.os.NetworkOnMainThreadException

    No message provided

    at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork()
  2. Android Platform
    StrictMode$AndroidBlockGuardPolicy.onNetwork
    1. android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1273)
    1 frame
  3. RoboVM
    OpenSSLSocketImpl$SSLOutputStream.write
    1. com.android.org.conscrypt.OpenSSLSocketImpl$SSLOutputStream.write(OpenSSLSocketImpl.java:755)
    1 frame
  4. com.android.okhttp
    RealBufferedSink.flush
    1. com.android.okhttp.okio.Okio$1.write(Okio.java:76)
    2. com.android.okhttp.okio.AsyncTimeout$1.write(AsyncTimeout.java:155)
    3. com.android.okhttp.okio.RealBufferedSink.flush(RealBufferedSink.java:221)
    3 frames
  5. Android
    HttpEngine.readResponse
    1. com.android.okhttp.internal.http.HttpConnection.flush(HttpConnection.java:141)
    2. com.android.okhttp.internal.http.HttpTransport.finishRequest(HttpTransport.java:52)
    3. com.android.okhttp.internal.http.HttpEngine.readNetworkResponse(HttpEngine.java:902)
    4. com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:788)
    4 frames
  6. com.android.okhttp
    HttpsURLConnectionImpl.getInputStream
    1. com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:443)
    2. com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:388)
    3. com.android.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:231)
    4. com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getInputStream(DelegatingHttpsURLConnection.java:210)
    5. com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java)
    5 frames
  7. com.android.backgroundchooser
    Main2Activity$1.onClick
    1. com.android.backgroundchooser.Main2Activity.getBitmapFromURL(Main2Activity.java:60)
    2. com.android.backgroundchooser.Main2Activity$1.onClick(Main2Activity.java:42)
    2 frames
  8. Android Platform
    ActivityThread.main
    1. android.view.View.performClick(View.java:5204)
    2. android.view.View$PerformClick.run(View.java:21156)
    3. android.os.Handler.handleCallback(Handler.java:739)
    4. android.os.Handler.dispatchMessage(Handler.java:95)
    5. android.os.Looper.loop(Looper.java:148)
    6. android.app.ActivityThread.main(ActivityThread.java:5466)
    6 frames
  9. Java RT
    Method.invoke
    1. java.lang.reflect.Method.invoke(Native Method)
    1 frame
  10. Android
    ZygoteInit.main
    1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
    2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
    2 frames