java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.neo.gson/com.example.neo.gson.MainActivity}: android.os.NetworkOnMainThreadException

Stack Overflow | Giorgio L | 4 months ago
  1. 0

    Android <uses-permission> not requesting permission

    Stack Overflow | 4 months ago | Giorgio L
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.neo.gson/com.example.neo.gson.MainActivity}: android.os.NetworkOnMainThreadException
  2. 0

    I am getting an error on getInputStream() and getOutputStream methods?

    Stack Overflow | 4 months ago | Hamza Khan
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.hfad.viscosity/com.hfad.viscosity.ProcessData}: android.os.NetworkOnMainThreadException
  3. 0

    Exception dispatching input event with jsoup get url

    Stack Overflow | 9 months ago | JimmyHo
    android.os.NetworkOnMainThreadException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  1. bayukresno 2 times, last 7 months ago
  2. dmitry 1 times, last 8 months ago
  3. 0x60 1 times, last 2 months ago
  4. adawolfs 4 times, last 4 months ago
  5. Bassiuz 1 times, last 5 months ago
13 more registered users
21 unregistered visitors
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. Java RT
    InetAddress.getAllByName
    1. java.net.InetAddress.lookupHostByName(InetAddress.java:436)
    2. java.net.InetAddress.getAllByNameImpl(InetAddress.java:252)
    3. java.net.InetAddress.getAllByName(InetAddress.java:215)
    3 frames
  4. Android
    HttpEngine.sendRequest
    1. com.android.okhttp.internal.Network$1.resolveInetAddresses(Network.java:29)
    2. com.android.okhttp.internal.http.RouteSelector.resetNextInetSocketAddress(RouteSelector.java:188)
    3. com.android.okhttp.internal.http.RouteSelector.nextProxy(RouteSelector.java:157)
    4. com.android.okhttp.internal.http.RouteSelector.next(RouteSelector.java:100)
    5. com.android.okhttp.internal.http.HttpEngine.createNextConnection(HttpEngine.java:357)
    6. com.android.okhttp.internal.http.HttpEngine.nextConnection(HttpEngine.java:340)
    7. com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:330)
    8. com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:248)
    8 frames
  5. com.android.okhttp
    HttpsURLConnectionImpl.getInputStream
    1. com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:433)
    2. com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:384)
    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
  6. com.example.neo
    MainActivity.onCreate
    1. com.example.neo.gson.MainActivity.onCreate(MainActivity.java:47)
    1 frame
  7. Android Platform
    ActivityThread.performLaunchActivity
    1. android.app.Activity.performCreate(Activity.java:6272)
    2. android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
    3. android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2387)
    3 frames