Ich versuche, org.apache.commons.collections.CollectionUtils in Android zu verwenden. Die Probe wird unterAndroid-Laufzeitfehler "java.lang.NoClassDefFoundError: org.apache.commons.collections.CollectionUtils"
import java.util.ArrayList;
import org.apache.commons.collections.CollectionUtils;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class CheckCommonsActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
String email1 = "[email protected]";
String email2 = "[email protected]";
String email3 = "[email protected]";
String email4 = null;
ArrayList<String> emailList1 = new ArrayList<String>();
emailList1.add(email4);
emailList1.add(email1);
emailList1.add(email2);
emailList1.add(email3);
ArrayList<String> emailList2 = new ArrayList<String>();
emailList2.add(email3);
emailList2.add(email2);
emailList2.add(email1);
boolean isEqual = CollectionUtils.isEqualCollection(emailList1,
emailList2);
TextView text = (TextView) findViewById(R.id.text);
text.setText(String.valueOf(isEqual));
}
}
I commons-Sammlungen-3.2.1.jar Build Path of Android-Projekt importiert haben, aber ich bin immer Fehler java.lang.NoClassDefFoundError: org.apache.commons.collections.CollectionUtils
zur Laufzeit.
Edit1
Dank
Versuche das Projekt zu säubern? : \ – st0le
@ st0le Reinigungsprojekt hilft nicht. –
Was gibt es in Android-Abhängigkeiten? – kosa