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.

android.os.NetworkOnMainThreadException
    at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1273)
    at java.net.InetAddress.lookupHostByName(InetAddress.java:431)
    at java.net.InetAddress.getAllByNameImpl(InetAddress.java:252)
    at java.net.InetAddress.getByName(InetAddress.java:305)
    at org.xbill.DNS.SimpleResolver.<init>(SimpleResolver.java:56)
    at org.xbill.DNS.SimpleResolver.<init>(SimpleResolver.java:68)
    at org.xbill.DNS.ExtendedResolver.<init>(ExtendedResolver.java:266)
    at org.xbill.DNS.Lookup.refreshDefault(Lookup.java:86)
    at org.jivesoftware.smack.SmackAndroid$1.onReceive(SmackAndroid.java:26)
    at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:879)

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) {
    Lockup.refreshDefault();
   }
}

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

Hope it helps.