android.os.NetworkOnMainThreadException

Exception #2887496

Samebug tips0

We couldn't find tips for this exception.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web1167

  • via GitHub by stratrik
    ,
  • via GitHub by ma3axaka007
    ,
  • Stack trace

    • android.os.NetworkOnMainThreadException at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2932) at android.app.ActivityThread.access$2100(ActivityThread.java:154) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1415) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5290) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:911) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:706) Caused by: android.os.NetworkOnMainThreadException at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1147) at libcore.io.BlockGuardOs.connect(BlockGuardOs.java:110) at libcore.io.IoBridge.connectErrno(IoBridge.java:137) at libcore.io.IoBridge.connect(IoBridge.java:122) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:183) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:163) at java.net.Socket.startupSocket(Socket.java:590) at java.net.Socket.tryAllAddresses(Socket.java:128) at java.net.Socket.<init>(Socket.java:178) at java.net.Socket.<init>(Socket.java:150) at out.Connection.connect(Connection.java:52) at my.app.client.Client.onStartCommand(Client.java:96) at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2915) ... 9 more

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Unknown visitor
    Unknown visitorOnce,
    Hiren AmaliyarHiren Amaliyar
    6 times, last one
    Indri YunitaIndri Yunita
    6 times, last one
    justCodeitjustCodeit
    7 times, last one
    AdrienAdrien
    4 times, last one
    38 more bugmates