Bur0k
Bur0k

Reputation: 136

Android java.lang.NoClassDefFoundError SherlockFragmentActivity

What i want to do: I want to start a new SherlockFragmentActivity.(mysecondactivity).

public class mysecondactivity extends SherlockFragmentActivity

I am doing that from a normal Activity:

Intent i = new Intent(this, mysecondactivity.class);
startActivity(i);

Sooo i am getting the following Error:

06-12 23:48:20.870: E/AndroidRuntime(18865): java.lang.NoClassDefFoundError: com.test.mysecodnactivity

(Error is pointing at the creation of the Intent above)

But if i change "extends SherlockFragmentActivity" to "extends Activity" the Error is gone.

Upvotes: 0

Views: 628

Answers (1)

danijoo
danijoo

Reputation: 2843

Seems to be a problem with your project setup. Are you sure you have added the sherlock library to your project?

If you are using eclipse and added actionbarsherlock project to your workspace: right click your own project -> properties -> android ->Library -> Add -> Choose your Actionbarsherlock project

then in the same window java build path -> Libraries -> be sure actionbarsherlock can be found under Android Dependencies or Android Private Libraries (im not sure)

then go to the Order and Export tab -> Android Private Libraries AND Android Dependencies has to be checked.

Then it should work.

Upvotes: 2

Related Questions