SASLErrorException: SASLError using DIGEST-MD5: not-authorized on Android

I want to study the IM on Android.

But this issue has troubled me for two days…

I used Smack-4.1.3.

I find the Smack-4.1.3 has just a little example…

My code:

try {
  XMPPTCPConnectionConfiguration config = XMPPTCPConnectionConfiguration
  .setUsernameAndPassword("ye", "admin")
  AbstractXMPPConnection conn2 = new XMPPTCPConnection(config);
  Log.e("TAG", String.valueOf(conn2.isConnected()));
  Log.e("TAG", "登录成功");
  } catch (SmackException e) {
  Log.e("TAG", "登录失败");
  } catch (IOException e) {
  Log.e("TAG", "登录失败");
  } catch (XMPPException e) {
  Log.e("TAG", "登录失败");

and my LogCat:

07-23 16:03:24.486: E/TAG(9778): true 07-23 16:03:24.516: W/System.err(9778): org.jivesoftware.smack.sasl.SASLErrorException: SASLError using DIGEST-MD5: not-authorized 07-23 16:03:24.516: W/System.err(9778): at org.jivesoftware.smack.SASLAuthentication.authenticationFailed(SASLAuthenticati 07-23 16:03:24.516: W/System.err(9778): at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPC 07-23 16:03:24.516: W/System.err(9778): at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$200(XMPPTCPCon 07-23 16:03:24.516: W/System.err(9778): at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$ 07-23 16:03:24.516: W/System.err(9778): at 07-23 16:03:24.516: E/TAG(9778): 登录失败

This is my first question…

Thank you for your any help.


Is ‘localhost’ really the service name/XMPP domain your XMPP service uses?

Thank you for your reply…


and I replaced “localhost” with “myreceiver” and “” , but still so…

Haha. I solved the problem.

This is now.

This is old.

I deleted a few .jar ,and login successful now.

Thank you sincerely!!!