Android: ClassNotFoundException when running ActionBarSherlock-Plugin-Maps
===

I am trying to setup an example project that uses Jake Wharton's [ActionBarSherlock][1] with [ActionBarSherlock-Plugin-Maps][2]. I follow the instructions [here][3] and [here][4]. I do not necessarily need Fragments. Here is the simple class I created.

    package com.example.actionbarsherlock;
    
    import android.os.Bundle;
    import com.actionbarsherlock.app.SherlockMapActivity;

    public class MainActivity extends SherlockMapActivity {
    
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
        }
    
    	@Override
    	protected boolean isRouteDisplayed() {
    		return false;
    	}
    }


Although I tried to follow the exact descriptions I end up with a `ClassNotFoundException` when I launch the application. Here is the stacktrace.

      Unable to resolve superclass of Lcom/actionbarsherlock/app/SherlockMapActivity; (729)
      Link of class 'Lcom/actionbarsherlock/app/SherlockMapActivity;' failed
      Unable to resolve superclass of Lcom/example/actionbarsherlock/MainActivity; (533)
      Link of class 'Lcom/example/actionbarsherlock/MainActivity;' failed
     D/AndroidRuntime(408): Shutting down VM
      threadid=3: thread exiting with uncaught exception (group=0x4001b188)
      Uncaught handler: thread main exiting due to uncaught exception

      java.lang.RuntimeException: Unable to instantiate activity 
        ComponentInfo{com.example.actionbarsherlock/com.example.actionbarsherlock.MainActivity}: 
        java.lang.ClassNotFoundException: com.example.actionbarsherlock.MainActivity
        in loader dalvik.system.PathClassLoader@44e8ca40

      	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2417)
      	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
      	at android.app.ActivityThread.access$2200(ActivityThread.java:119)
      	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
      	at android.os.Handler.dispatchMessage(Handler.java:99)
      	at android.os.Looper.loop(Looper.java:123)
      	at android.app.ActivityThread.main(ActivityThread.java:4363)
      	at java.lang.reflect.Method.invokeNative(Native Method)
      	at java.lang.reflect.Method.invoke(Method.java:521)
      	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
      	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
      	at dalvik.system.NativeStart.main(Native Method)

      Caused by: java.lang.ClassNotFoundException: com.example.actionbarsherlock.MainActivity 
        in loader dalvik.system.PathClassLoader@44e8ca40

      	at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
      	at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
      	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2409)
      	... 11 more
      threadid=7: reacting to signal 3
      Unable to open stack trace file '/data/anr/traces.txt': Permission denied

I tested the library before and created a subclass of `SherlockActivity` which worked fine. While doing so, I noticed that the same `ClassNotFoundException` occurs when I forget to configure the `android:theme` setting in `AndroidManifest.xml`. Here is the file for both (`SherlockActivity` and `SherlockMapActivity`) example projects, just in case:

    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.example.actionbarsherlock"
        android:versionCode="1"
        android:versionName="1.0" >
        <uses-sdk
            android:minSdkVersion="7"
            android:targetSdkVersion="15" />
        <application
            android:icon="@drawable/ic_launcher"
            android:label="@string/app_name"
            android:theme="@style/AppTheme" >
            <activity
                android:theme="@style/Theme.Sherlock"
                android:name=".MainActivity"
                android:label="@string/title_activity_main" >
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
        </application>
    </manifest> 

  [1]: https://github.com/JakeWharton/ActionBarSherlock
  [2]: https://github.com/JakeWharton/ActionBarSherlock-Plugin-Maps
  [3]: http://stackoverflow.com/a/10041252/356895
  [4]: http://stackoverflow.com/a/11223857/356895