Error: cannot access SaslException class file for javax.security.sasl.SaslException not found

I want to use the latest release of smack 4.0.0 in my project for xmpp with android studio 0.6.0,the code as below:

try{ ConnectionConfiguration config = new ConnectionConfiguration("wooxonline.com",4000); XMPPConnection connection = new XMPPTCPConnection(config); connection.connect(); connection.login("cliff","cliff123"); } catch (SmackException e) { e.printStackTrace(); } catch (java.io.IOException e) { e.printStackTrace(); } catch (XMPPException e) { e.printStackTrace(); Log.i(TAG, "login failed!"); }

this almost like sample with the smack sample code,but I have a compile issue that can’t be solved as below trace info:

Error: (58, 29) error: cannot access SaslException class file for javax.security.sasl.SaslException not found

I’m stuck here and anyone can help to have a look?

Smack 4.0 does not work on Android. You need aSmack or Smack 4.1.

1 Like

So, using this code with aSmack lib will work?

i updated aSmack in android,but it can’t be resolve in “import org.jivesoftware.smack.SmackException”…