Android XMPP using smack: First attempt always fail

We are using asmack library (asmack-android-10-0.8.10) in our android app, we use it in order to connect to our XMPP server. Always in the first attempt we get an error:

xmppServicesBot [services.myvoco.net] xmppServer +[xmpp.myvoco.net]
W/System.err(16560): service-unavailable(503)
W/System.err(16560):     at org.jivesoftware.smack.NonSASLAuthentication.authenticate(NonSASLAuthentication.java:77)
W/System.err(16560):     at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:251)
W/System.err(16560):     at com.navvo.android.grasshopper.xmpp.MyVoco.connect(MyVoco.java:586)
W/System.err(16560):     at com.navvo.android.grasshopper.xmpp.MyVoco.xmppThread(MyVoco.java:479)
W/System.err(16560):     at com.navvo.android.grasshopper.xmpp.MyVoco.access$000(MyVoco.java:47)
W/System.err(16560):     at com.navvo.android.grasshopper.xmpp.MyVoco$1.run(MyVoco.java:118) (16560): [xmppThread] Connect Failed, sleeping 1 second and trying again.

Then the app waits for a second in order to retry the connection,then on the second attempt the app is able to connect into the servers. I’m not sure why we get this condition? We think it is a race condition, because if we delay the first attempt in 5 seconds, we get the connection without any error.

I really appreciate some help

Thanks

I don’t think it’s a race. I guess you could simply debug the code to determine what’s causing this. I also recommend switching to a more recent aSmack version (4.0.6 at the time of writing).