javaandroidactionbarsherlockactionbarsherlock-map

Starting an Activity which extends SherlockMapActivity throws a NoClassDefFoundError exception


I'm trying to use the SherlockMapActivity to use the Sherlock action bar on a maps activity. But when the activity which extends from SherlockMapActivity is started a NoClassDefFoundError exception is thrown telling me the class cannot be found.

When I change the implementation and use the normal MapActivity as a base class then the activity starts without any problems.

I included the actionbarsherlock-plugin-maps-4.0.0.jar int the lib folder and included it in the class path. Support library 4 is also included. The Sherlock action bar works an all other activities which don't extend from SherlockMapActivity.

I don't now whether this might be important,the map activity using the Sherlock action bar is part of a library project.

Any ideas on that?

UPDATE

08-29 23:08:38.326: E/AndroidRuntime(8862): FATAL EXCEPTION: main
08-29 23:08:38.326: E/AndroidRuntime(8862): java.lang.NoClassDefFoundError: com.appandmore.android.storefinder.core.ui.activity.RadiusStoreActivity
08-29 23:08:38.326: E/AndroidRuntime(8862):     at com.appandmore.android.storefinder.core.ui.activity.HomeActivity.onClick(HomeActivity.java:70)
08-29 23:08:38.326: E/AndroidRuntime(8862):     at android.view.View.performClick(View.java:2506)
08-29 23:08:38.326: E/AndroidRuntime(8862):     at android.view.View$PerformClick.run(View.java:9112)
08-29 23:08:38.326: E/AndroidRuntime(8862):     at android.os.Handler.handleCallback(Handler.java:587)
08-29 23:08:38.326: E/AndroidRuntime(8862):     at android.os.Handler.dispatchMessage(Handler.java:92)
08-29 23:08:38.326: E/AndroidRuntime(8862):     at android.os.Looper.loop(Looper.java:130)
08-29 23:08:38.326: E/AndroidRuntime(8862):     at android.app.ActivityThread.main(ActivityThread.java:3835)
08-29 23:08:38.326: E/AndroidRuntime(8862):     at java.lang.reflect.Method.invokeNative(Native Method)
08-29 23:08:38.326: E/AndroidRuntime(8862):     at java.lang.reflect.Method.invoke(Method.java:507)
08-29 23:08:38.326: E/AndroidRuntime(8862):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864)
08-29 23:08:38.326: E/AndroidRuntime(8862):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622)
08-29 23:08:38.326: E/AndroidRuntime(8862):     at dalvik.system.NativeStart.main(Native Method)

UPDATE 2

I've temporarily replaced the map activity with a plain one, containing no custom code, just extending SherlockMapActivty. It crashed to the same reason.


Solution

  • You have to keep your .jar file inside libs not lib folder after ADT-17. Also, its not mandatory to Build Path it will be managed on its own.