Here are some of the anomalies I've been studying asmack4.0.
06-17 12:02:56.924:w/system.err (10622): org.jivesoftware.smack.smackexception$connectionexception
06-17 12:02:56.924:w/system.err (10622): at Org.jivesoftware.smack.tcp.XMPPTCPConnection.connectUsingConfigurati On (XMPPTCPC onnection.java:431)
06-17 12:02:56.940:w/system.err (10622): at Org.jivesoftware.smack.tcp.XMPPTCPConnection.connectInternal (xmpptcp Connection. java:799)
06-17 12:02:56.940:w/system.err (10622): at Org.jivesoftware.smack.XMPPConnection.connect (xmppconnection.java:39 1)
06-17 12:02:56.940:w/system.err (10622): at Com.example.testchat.MainActivity.test (mainactivity.java:121)
06-17 12:02:56.940:w/system.err (10622): at Com.example.testchat.mainactivity.access$0 (MainActivity.java:56)
06-17 12:02:56.940:w/system.err (10622): at Com.example.testchat.mainactivity$1.run (mainactivity.java:34)
06-17 12:02:56.940:w/system.err (10622): at Java.lang.Thread.run (thread.java:856)
Find a variety of methods also failed to solve, and finally stumbled upon this
Connectionconfig = new Connectionconfiguration (
Loginconfig.getxmpphost (), Loginconfig.getxmppport (),
Loginconfig.getxmppservicename ());
Connectionconfig.setsecuritymode (securitymode.enabled);
Safe Mode, yes, Safe mode leads to authentication failure. So I changed it to disabled, and the problem was solved.
Asmack Connection Server Exception smack.smackexception$ connectionexception thrown by Xmppconnection.connect ();