Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

  1. ,
    via Stack Overflow by Razgriz

    Happens when you make a network call on the main UI thread of the Android application which results in a UI freeze until the network call is complete and the response is received. Instead, execute the network calls in the background: use AsyncTask.

  2. ,

    An alternative for just getting rid of the Exception is use StrictMode.ThreadPolicy to force execute on main thread.

    StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
    StrictMode.setThreadPolicy(policy);
    

Solutions on the web

via GitHub by samueltardieu
, 2 years ago
Fatal Exception thrown on Scheduler.Worker thread.
via Stack Overflow by AMT16
, 11 months ago
Fatal Exception thrown on Scheduler.Worker thread.
via google.com by Unknown author, 2 years ago
Fatal Exception thrown on Scheduler.Worker thread.
via GitHub by artem-zinnatullin
, 1 year ago
Fatal Exception thrown on Scheduler.Worker thread.
via GitHub by Jaikant
, 1 year ago
Fatal Exception thrown on Scheduler.Worker thread.
via GitHub by AndwareSsj
, 1 year ago
Fatal Exception thrown on Scheduler.Worker thread.
android.os.NetworkOnMainThreadException: 	at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1128)	at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.close(OpenSSLSocketImpl.java:906)	at com.squareup.okhttp.Connection.closeIfOwnedBy(Connection.java:148)	at com.squareup.okhttp.OkHttpClient$1.closeIfOwnedBy(OkHttpClient.java:75)	at com.squareup.okhttp.internal.http.HttpConnection.closeIfOwnedBy(HttpConnection.java:137)	at com.squareup.okhttp.internal.http.HttpTransport.disconnect(HttpTransport.java:135)	at com.squareup.okhttp.internal.http.HttpEngine.disconnect(HttpEngine.java:573)	at com.squareup.okhttp.Call.cancel(Call.java:122)	at retrofit.OkHttpCall.cancel(OkHttpCall.java:162)	at retrofit.RxJavaCallAdapterFactory$CallOnSubscribe$1.call(RxJavaCallAdapterFactory.java:102)	at rx.subscriptions.BooleanSubscription.unsubscribe(BooleanSubscription.java:71)	at rx.internal.util.SubscriptionList.unsubscribeFromAll(SubscriptionList.java:124)	at rx.internal.util.SubscriptionList.unsubscribe(SubscriptionList.java:113)	at rx.Subscriber.unsubscribe(Subscriber.java:98)	at rx.internal.util.SubscriptionList.unsubscribeFromAll(SubscriptionList.java:124)	at rx.internal.util.SubscriptionList.unsubscribe(SubscriptionList.java:113)	at rx.Subscriber.unsubscribe(Subscriber.java:98)	at rx.internal.util.SubscriptionList.unsubscribeFromAll(SubscriptionList.java:124)	at rx.internal.util.SubscriptionList.unsubscribe(SubscriptionList.java:113)	at rx.Subscriber.unsubscribe(Subscriber.java:98)	at rx.observers.SafeSubscriber.onCompleted(SafeSubscriber.java:95)	at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber.pollQueue(OperatorObserveOn.java:195)	at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber$2.call(OperatorObserveOn.java:162)	at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)	at android.os.Handler.handleCallback(Handler.java:725)	at android.os.Handler.dispatchMessage(Handler.java:92)	at android.os.Looper.loop(Looper.java:153)	at android.app.ActivityThread.main(ActivityThread.java:5340)	at java.lang.reflect.Method.invokeNative(Method.java:-2)	at java.lang.reflect.Method.invoke(Method.java:511)	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)	at dalvik.system.NativeStart.main(NativeStart.java:-2)