I have the same problem. i didn't include xpp3-1.1.4c.jar and by logging the code i can connect to the server but after that it throws an error. My code is below.
private class LongOperation extends AsyncTask<String, Void, String> {
@Override
protected String doInBackground(String... params) {
ConnectionConfiguration connConfig = null;
try {
connConfig = new ConnectionConfiguration(HOST, PORT, SERVICE);
} catch (Exception e1) {
// TODO Auto-generated catch block
Log.d("memo", "wrong config");
e1.printStackTrace();
}
AbstractXMPPConnection connection = new XMPPTCPConnection(connConfig);
try {
Log.d("memo", "trying to connect");
connection.connect();
Log.d("memo", "connected to the server");
Log.d("memo", connection.getHost());
} catch (XMPPException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Log.d("memo", "xmppexception");
} catch (SmackException e) {
// TODO Auto-generated catch block
Log.d("memo", "smackexemption");
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
Log.d("memo", "ioexcemption");
e.printStackTrace();
}
return "Executed";
}
Logcat:
11-29 20:13:56.774: E/AndroidRuntime(28311): FATAL EXCEPTION: Smack Packet Reader (0)
11-29 20:13:56.774: E/AndroidRuntime(28311): java.lang.NoClassDefFoundError: org.jxmpp.util.XmppStringUtils
11-29 20:13:56.774: E/AndroidRuntime(28311): at org.jivesoftware.smack.ConnectionConfiguration.setServiceName(ConnectionConfigu ration.java:216)
11-29 20:13:56.774: E/AndroidRuntime(28311): at org.jivesoftware.smack.AbstractXMPPConnection.setServiceName(AbstractXMPPConnec tion.java:469)
11-29 20:13:56.774: E/AndroidRuntime(28311): at org.jivesoftware.smack.tcp.XMPPTCPConnection.access$800(XMPPTCPConnection.java: 132)
11-29 20:13:56.774: E/AndroidRuntime(28311): at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPC onnection.java:1055)
11-29 20:13:56.774: E/AndroidRuntime(28311): at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$200(XMPPTCPCon nection.java:969)
11-29 20:13:56.774: E/AndroidRuntime(28311): at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnecti on.java:988)
11-29 20:13:53.561: D/memo(28311): trying to connect
11-29 20:13:56.764: D/memo(28311): connected to the server
11-29 20:13:56.764: D/memo(28311): 192.168.......something.
My question is after connecting to the server how come an error like this can happen thanks in advance.