title: Connecting to XMPP server from android
body: <p>The same code is working if I run the class from eclipse as a java application but when I am using same class in android studio I am getting the following <code>RuntimeException</code>.</p>
  
  <pre><code>java.lang.NoClassDefFoundError: Failed resolution of: Ljavax/security/sasl/Sasl; 
  </code></pre>
  
  <p><strong>The log :</strong></p>
  
  <pre><code>FATAL EXCEPTION: Thread-62267
  Process: com.abcd.abcd, PID: 14825
  java.lang.NoClassDefFoundError: Failed resolution of: Ljavax/security/sasl/Sasl;
  at org.jivesoftware.smack.sasl.SASLMechanism.authenticate(SASLMechanism.java:92)
  at org.jivesoftware.smack.SASLAuthentication.authenticate(SASLAuthentication.java:319)
  at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:203)
  at com.abcd.abcd.XmppManager.login(XmppManager.java:99)
  at com.abcd.abcd.Main.initializeXmppConnection(Main.java:78)
  at com.abcd.abcd.Main.init(Main.java:72)
  at com.abcd.abcd.Main.&lt;init&gt;(Main.java:61)
  at com.abcd.abcd.MainActivity$1.run(MainActivity.java:32)
  at java.lang.Thread.run(Thread.java:818)
  Caused by: java.lang.ClassNotFoundException: Didn't find class "javax.security.sasl.Sasl" on path: DexPathList[[zip file "/data/app/com.abcd.abcd-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
  at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
  at org.jivesoftware.smack.sasl.SASLMechanism.authenticate(SASLMechanism.java:92) 
  at org.jivesoftware.smack.SASLAuthentication.authenticate(SASLAuthentication.java:319) 
  at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:203) 
  at com.abcd.abcd.XmppManager.login(XmppManager.java:99) 
  at com.abcd.abcd.Main.initializeXmppConnection(Main.java:78) 
  at com.abcd.abcd.Main.init(Main.java:72) 
  at com.abcd.abcd.Main.&lt;init&gt;(Main.java:61) 
  at com.abcd.abcd.MainActivity$1.run(MainActivity.java:32) 
  at java.lang.Thread.run(Thread.java:818) 
  Suppressed: java.lang.ClassNotFoundException: javax.security.sasl.Sasl
  at java.lang.Class.classForName(Native Method)
  at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
  at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
  ... 10 more
  Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
  </code></pre>
  
  <p>I am stuck here and really not getting what the problem is. Any help guys?</p>