Error receiving broadcast Intent at org.jivesoftware.smack.SmackAndroid$1.onReceive

My asmack library has bug, please tell me the correct asmack library version and download address, or tell me other solutions. Thank you very much!

An occasional flash back occurred in App. See the code and picture descriptions for details. (Lookup.refreshDefault) related to the operation of the network, the main thread cannot carry out the network operation, the onReceive method should start a new thread, but I cannot find the asmack library source code, the code can not be modified, I only class files. Please have experienced developers tell me how to solve this problem.

    at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(
    at org.xbill.DNS.SimpleResolver.<init>(
    at org.xbill.DNS.SimpleResolver.<init>(
    at org.xbill.DNS.ExtendedResolver.<init>(
    at org.xbill.DNS.Lookup.refreshDefault(
    at org.jivesoftware.smack.SmackAndroid$1.onReceive(

Crash log screenshot

Error code location

This NetworkOnMainThreadException occurred when you try to access internet on UI or main thread.

For accessing internet in android application you need to create an AsyncTask or service.

Create an AsyncTask in your activity.

class Refresh extends AsyncTask<Void, Void, Void> {

protected Void doInBackground(String... params) {

And replace Lockup.refreshDefault(); this line with new Refresh().execute();

Hope it helps.