android.os.NetworkOnMainThreadException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • RoadManager error
    via GitHub by Ewrei
    ,
  • App stopped while calling registerToken
    via Stack Overflow by user7303261
    ,
  • Search in Android won't work; app crashes
    via Stack Overflow by Alex B.
    ,
  • okhttp3 : writing to MySQL from Android
    via Stack Overflow by Marc
    ,
    • android.os.NetworkOnMainThreadException at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1147) at java.net.InetAddress.lookupHostByName(InetAddress.java:418) at java.net.InetAddress.getAllByNameImpl(InetAddress.java:252) at java.net.InetAddress.getAllByName(InetAddress.java:215) at okhttp3.Dns$1.lookup(Dns.java:39) at okhttp3.internal.connection.RouteSelector.resetNextInetSocketAddress(RouteSelector.java:172) at okhttp3.internal.connection.RouteSelector.nextProxy(RouteSelector.java:138) at okhttp3.internal.connection.RouteSelector.next(RouteSelector.java:80) at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:178) at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:129) at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:98) at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67) at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:109) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67) at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:124) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67) at com.pokegoapi.auth.PtcCredentialProvider$2.intercept(PtcCredentialProvider.java:95) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67) at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:170) at okhttp3.RealCall.execute(RealCall.java:60) at com.pokegoapi.auth.PtcCredentialProvider.login(PtcCredentialProvider.java:120) at com.pokegoapi.auth.PtcCredentialProvider.<init>(PtcCredentialProvider.java:101) at com.pokegoapi.examples.CatchPokemonAtAreaExample.main(CatchPokemonAtAreaExample.java:62) at com.example.mpcom.testapi30.MainActivity$1.onClick(MainActivity.java:33) at android.view.View.performClick(View.java:5197) at android.view.View$PerformClick.run(View.java:20926) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:145) at android.app.ActivityThread.main(ActivityThread.java:5951) 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:1400)

    Users with the same issue

    filpgame
    filpgame1 times, last one,
    adawolfs
    adawolfs4 times, last one,
    Bassiuz
    Bassiuz1 times, last one,
    jk
    jk12 times, last one,
    Agócs Tamás
    Agócs Tamás14 times, last one,
    38 more bugmates