"SASLError using DIGEST-MD5: not-authorized" error with Smack 4.1 in android

My Gradle

My Java code

The debug info

06-03 17:46:12.025 22036-22193/com.example.quinn.hellostudio D/SMACK﹕ SENT (0): <stream:stream xmlns=‘jabber:client’ to=‘10.180.152.74’ xmlns:stream=‘http://etherx.jabber.org/streams’ version=‘1.0’ from=‘peter@10.180.152.74’ xml:lang=‘en’>

06-03 17:46:12.030 22036-22194/com.example.quinn.hellostudio D/SMACK﹕ RECV (0): <?xml version='1.0' encoding='UTF-8'?><stream:stream xmlns:stream=“http://etherx.jabber.org/streams” xmlns=“jabber:client” from=“127.0.0.1” id=“eb875d55” xml:lang=“en” version=“1.0”>

06-03 17:46:12.035 22036-22194/com.example.quinn.hellostudio D/SMACK﹕ RECV (0): stream:featuresDIGEST-MD5PLAINANONYMOUSCRAM-MD5</mech anism>zlib</stream:features>

06-03 17:46:12.040 22036-22193/com.example.quinn.hellostudio D/SMACK﹕ SENT (0): =

06-03 17:46:12.065 22036-22194/com.example.quinn.hellostudio D/SMACK﹕ RECV (0): cmVhbG09IjEyNy4wLjAuMSIsbm9uY2U9Ik5DS3 dFcUNFdUZzNVVXS1BNc3A0VFdXUU9sRyt2NGVSMWRBNkpBdkEiLHFvcD0iYXV0aCIsY2hhcnNldD11dG YtOCxhbGdvcml0aG09bWQ1LXNlc3M=

06-03 17:46:12.065 22036-22193/com.example.quinn.hellostudio D/SMACK﹕ SENT (0): dXNlcm5hbWU9InBldGVyIixyZWFsbT0iMTAuMT gwLjE1Mi43NCIsbm9uY2U9Ik5DS3dFcUNFdUZzNVVXS1BNc3A0VFdXUU9sRyt2NGVSMWRBNkpBdkEiLG Nub25jZT0iSGtPZlNHTzNzcTVpMXQ4YThteHVqMjlYcFVQNVVpZk8iLG5jPTAwMDAwMDAxLHFvcD1hdX RoLGRpZ2VzdC11cmk9InhtcHAvMTAuMTgwLjE1Mi43NCIscmVzcG9uc2U9ZDY5Y2M0MGVmZjc4NjNhZD E4ZTg1MDZkYjBkMmZmYTYsY2hhcnNldD11dGYtOA==

06-03 17:46:12.070 22036-22194/com.example.quinn.hellostudio D/SMACK﹕ RECV (0):

The exception stack

I google a lot ,but I have not solved this problem, hope to find some help here.Thx.

Could you please try setService(“your service name”)? This is not the same as setHost.

service name ?

Do you mean the host name,the below image is catch from my Openfire homepage, and my Host name is QuinndeMacBook-Pro.local,

I tried it,But it does not work,

Even in my case the server is installed locally. In my case, I have set the service to localhost. Try setting 127.0.0.1 to see if it helps.

Image.png

Great! I solve it ! Thx a lot !