Pattern selector

Most relevant patterns first. Most helpful ones displayed. Click here to show all.

  1. OpenSSLSocketImpl.close() has thrown a NetworkOnMainThreadException
    Unsorted
    4
    10
    0
  2. Executed network call on the main thread
    Android
    876
    145
    13

Your stack trace compared to the selected pattern

Jump to solutionsExpand frames
android.os.NetworkOnMainThreadException
    at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1145)
    at com.android.org.conscrypt.OpenSSLSocketImpl.shutdownAndFreeSslNative(OpenSSLSocketImpl.java:1102)
    at com.android.org.conscrypt.OpenSSLSocketImpl.close(OpenSSLSocketImpl.java:1097)
    at org.apache.http.impl.SocketHttpClientConnection.close(SocketHttpClientConnection.java:205)
6 frames hidden

Solution

Larten5 months ago

You must execute network calls on a background thread and not on the main thread.

Read more: https://developer.android.com/training/articles/perf-anr

External results for this pattern (10)

  1. Daniel Gugervia Google Groups2 weeks ago
    No message found for this stack trace.
    Show stack trace
  2. Abianue1via GitHub3 weeks ago
    No message found for this stack trace.
    Show stack trace
  3. flatfishervia GitHub2 months ago
    No message found for this stack trace.
    Show stack trace
  4. kordianbruckvia GitHub2 months ago
    No message found for this stack trace.
    Show stack trace
  5. blurpyvia GitHub2 months ago
    No message found for this stack trace.
    Show stack trace
  6. casic71via GitHub2 months ago
    No message found for this stack trace.
    Show stack trace
  7. bkhezryvia GitHub2 months ago
    No message found for this stack trace.
    Show stack trace
  8. rezaf28via GitHub2 months ago
    No message found for this stack trace.
    Show stack trace
  9. Dr-Faustvia GitHub2 months ago
    No message found for this stack trace.
    Show stack trace
  10. No message found for this stack trace.
    Show stack trace