Smack in android problem:NoClassDefFoundError: Failed resolution

I create the test project Smack4_1 (IDE:Eclipse)

step 1:new android project

step 2:import smack4.1.0 libs

step 3: when I used the code,throw Exception

import java.io.IOException;

import org.jivesoftware.smack.SmackException;

import org.jivesoftware.smack.XMPPException;

import org.jivesoftware.smack.tcp.XMPPTCPConnection;

import org.jivesoftware.smack.tcp.XMPPTCPConnectionConfiguration;

import org.jivesoftware.smack.ConnectionConfiguration;

import android.app.Activity;

import android.os.Bundle;

import android.view.Menu;

import android.view.MenuItem;

import android.view.View;

public class MainActivity extends Activity {

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);

}

public void onClick(View v){

new Thread(new Runnable() {

@Override

public void run() {

try {

XMPPTCPConnection connection = getConnection();

connection.connect();

connection.login(“anytime_eeeeee”,“qq123456”,“ubuntu”);

} catch (SmackException e) {

e.printStackTrace();

} catch (IOException e) {

e.printStackTrace();

} catch (XMPPException e) {

e.printStackTrace();

} catch (Exception e) {

e.printStackTrace();

}

}

}).start();

}

private XMPPTCPConnection getConnection(){

XMPPTCPConnectionConfiguration.Builder builder = XMPPTCPConnectionConfiguration.builder();//Exception throws in here

// builder.setServiceName(“ubuntu”);

builder.setHost(“58.64.162.184”);

builder.setPort(5222);

builder.setCompressionEnabled(false);

builder.setDebuggerEnabled(false);

builder.setSendPresence(true);

builder.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled);

XMPPTCPConnection connection = new XMPPTCPConnection(builder.build());

return connection;

}

}

when I click the button,throws Exception:

What’s mean? thanks every one !
Smack4_1.rar (2495511 Bytes)

I create another project ,use Android5.1 lib .success!

thanks the gay :Android client using Smack-4.1.0 Api Backend Openfire

I have the same problem.Could you give the right smack jars.Thanks

Exception trace shows that you are missing the SmackConfiguration class file.

In Smack 4.1.3 the jar is a part of smack-core.jar.

I have the following code in build.gradle file in order to have smack working.

compile “org.igniterealtime.smack:smack-android:4.1.3”

compile “org.igniterealtime.smack:smack-bosh:4.1.3”

compile “org.igniterealtime.smack:smack-tcp:4.1.3”

compile “org.igniterealtime.smack:smack-im:4.1.3”

compile “com.googlecode.libphonenumber:libphonenumber:3.5”

compile “org.jxmpp:jxmpp-jid:0.5.0-alpha6”

compile “org.igniterealtime.smack:smack-extensions:4.1.3”

哥们,我现在用smack-4.1.3,写了一个创建链接的demo,和你报一样的错误,试了好多办法都没解决,跪求帮助啊