android.os.NetworkOnMainThreadException

GitHub | mpcom00 | 8 months ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. Speed up your debug routine!

    Automated exception search integrated into your IDE

  2. 0

    okhttp3 : writing to MySQL from Android

    Stack Overflow | 1 year ago | Marc
    android.os.NetworkOnMainThreadException
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:1147)
    1 frame
  3. Java RT
    InetAddress.getAllByName
    1. java.net.InetAddress.lookupHostByName(InetAddress.java:418)
    2. java.net.InetAddress.getAllByNameImpl(InetAddress.java:252)
    3. java.net.InetAddress.getAllByName(InetAddress.java:215)
    3 frames
  4. okhttp3
    Dns$1.lookup
    1. okhttp3.Dns$1.lookup(Dns.java:39)
    1 frame
  5. okhttp3.internal.connection
    ConnectInterceptor.intercept
    1. okhttp3.internal.connection.RouteSelector.resetNextInetSocketAddress(RouteSelector.java:172)
    2. okhttp3.internal.connection.RouteSelector.nextProxy(RouteSelector.java:138)
    3. okhttp3.internal.connection.RouteSelector.next(RouteSelector.java:80)
    4. okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:178)
    5. okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:129)
    6. okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:98)
    7. okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
    7 frames
  6. okhttp3.internal.http
    RealInterceptorChain.proceed
    1. okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
    2. okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
    2 frames
  7. okhttp3.internal.cache
    CacheInterceptor.intercept
    1. okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:109)
    1 frame
  8. okhttp3.internal.http
    RealInterceptorChain.proceed
    1. okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
    2. okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
    3. okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
    4. okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
    5. okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:124)
    6. okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
    7. okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
    7 frames
  9. com.pokegoapi.auth
    PtcCredentialProvider$2.intercept
    1. com.pokegoapi.auth.PtcCredentialProvider$2.intercept(PtcCredentialProvider.java:95)
    1 frame
  10. okhttp3.internal.http
    RealInterceptorChain.proceed
    1. okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
    2. okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
    2 frames
  11. okhttp3
    RealCall.execute
    1. okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:170)
    2. okhttp3.RealCall.execute(RealCall.java:60)
    2 frames
  12. com.pokegoapi.auth
    PtcCredentialProvider.<init>
    1. com.pokegoapi.auth.PtcCredentialProvider.login(PtcCredentialProvider.java:120)
    2. com.pokegoapi.auth.PtcCredentialProvider.<init>(PtcCredentialProvider.java:101)
    2 frames
  13. com.pokegoapi.examples
    CatchPokemonAtAreaExample.main
    1. com.pokegoapi.examples.CatchPokemonAtAreaExample.main(CatchPokemonAtAreaExample.java:62)
    1 frame
  14. com.example.mpcom
    MainActivity$1.onClick
    1. com.example.mpcom.testapi30.MainActivity$1.onClick(MainActivity.java:33)
    1 frame
  15. Android Platform
    ActivityThread.main
    1. android.view.View.performClick(View.java:5197)
    2. android.view.View$PerformClick.run(View.java:20926)
    3. android.os.Handler.handleCallback(Handler.java:739)
    4. android.os.Handler.dispatchMessage(Handler.java:95)
    5. android.os.Looper.loop(Looper.java:145)
    6. android.app.ActivityThread.main(ActivityThread.java:5951)
    6 frames
  16. Java RT
    Method.invoke
    1. java.lang.reflect.Method.invoke(Native Method)
    2. java.lang.reflect.Method.invoke(Method.java:372)
    2 frames
  17. Android
    ZygoteInit$MethodAndArgsCaller.run
    1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)
    1 frame