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 Stack Overflow by paolo pace
, 1 year ago
Unable to start receiver pi.blackoutwidget.Temperature: android.os.NetworkOnMainThreadException
via JIRA by siewsin, 2 years ago
Unable to start receiver com.android.settings.cyanogenmod.BootReceiver: java.lang.NullPointerException: Attempt to invoke interface method 'int cyanogenmod.hardware.ICMHardwareService.getSupportedFeatures()' on a null object reference
via Stack Overflow by Bedrock Dev
, 2 years ago
Unable to start receiver com.bedrock.live.service.WiFiService: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference
via JIRA by siewsin, 1 year ago
Unable to start receiver com.android.settings.cyanogenmod.BootReceiver: java.lang.NullPointerException: Attempt to invoke interface method 'int cyanogenmod.hardware.ICMHardwareService.getSupportedFeatures()' on a null object reference
via Stack Overflow by Bedrock Dev
, 1 year ago
Unable to start receiver com.bedrock.live.service.WiFiService: java.lang.IllegalStateException: Couldn't read row 0, col -1 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it.
via JIRA by Rachid Achellal, 1 year ago
Unable to start receiver com.android.settings.cyanogenmod.BootReceiver: java.lang.IllegalArgumentException: Invalid int: "null"
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:456)	at java.net.Socket.connect(Socket.java:882)	at com.android.okhttp.internal.Platform.connectSocket(Platform.java:174)	at com.android.okhttp.Connection.connect(Connection.java:152)	at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:276)	at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:211)	at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:382)	at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:332)	at com.android.okhttp.internal.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:199)	at java.net.URL.openStream(URL.java:470)	at pi.blackoutwidget.Temperature.updateAppWidget(Temperature.java:28)	at pi.blackoutwidget.Temperature.onUpdate(Temperature.java:48)	at android.appwidget.AppWidgetProvider.onReceive(AppWidgetProvider.java:66)	at android.app.ActivityThread.handleReceiver(ActivityThread.java:2654)