Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NoClassDefFoundError Android with ActionBarActivity

I currently have an ActionBarActivity which always returns a NoClassDefFoundError. I've read that it might be a problem with the ADT but I cannot be sure, hence my question. I've imported the ActionBar sample from the Android samples under

android-sdk\samples\android-14\ActionBarCompat

I've labelled the ActionBarCompat project as a library under Project -> Properties but I'm still getting the error.

To reiterator:

public class SearchActivity extends ActionBarActivity { // Doesn't work, yields exception

public class SearchActivity extends Activity { // Works perfectly

Has anyone else experienced a similar error and perhaps found a solution?

Thanks in advance.

like image 450
justin.saliba Avatar asked Apr 21 '26 22:04

justin.saliba


1 Answers

http://developer.android.com/tools/support-library/setup.html The "Adding libraries with resources" section may help since this is not in the most common v4 support library

include only android-support-v4.jar is not enough

like image 101
Tse Ka Leong Avatar answered Apr 24 '26 12:04

Tse Ka Leong



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!