title: Android RunTimeError: Java.lang.RunTimeException: Unable to Instantiate activity
body: <p>I am getting the following error every time I run my android app on an AVD. The app crashes almost instantly upon running it:</p>
  
  <pre><code>    08-24 02:18:01.629: E/AndroidRuntime(1860): FATAL EXCEPTION: main
  08-24 02:18:01.629: E/AndroidRuntime(1860): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.zamani.randomizedworkout/com.zamani.randomizedworkout.MainScreen}: java.lang.ClassNotFoundException: Didn't find class "com.zamani.randomizedworkout.MainScreen" on path: DexPathList[[zip file "/system/framework/android.test.runner.jar", zip file "/data/app/com.zamani.randomizedworkout-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.zamani.randomizedworkout-2, /system/lib]]
  08-24 02:18:01.629: E/AndroidRuntime(1860):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2137)
  08-24 02:18:01.629: E/AndroidRuntime(1860):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
  08-24 02:18:01.629: E/AndroidRuntime(1860):     at android.app.ActivityThread.access$600(ActivityThread.java:141)
  08-24 02:18:01.629: E/AndroidRuntime(1860):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
  08-24 02:18:01.629: E/AndroidRuntime(1860):     at android.os.Handler.dispatchMessage(Handler.java:99)
  08-24 02:18:01.629: E/AndroidRuntime(1860):     at android.os.Looper.loop(Looper.java:137)
  08-24 02:18:01.629: E/AndroidRuntime(1860):     at android.app.ActivityThread.main(ActivityThread.java:5103)
  08-24 02:18:01.629: E/AndroidRuntime(1860):     at java.lang.reflect.Method.invokeNative(Native Method)
  08-24 02:18:01.629: E/AndroidRuntime(1860):     at java.lang.reflect.Method.invoke(Method.java:525)
  08-24 02:18:01.629: E/AndroidRuntime(1860):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
  08-24 02:18:01.629: E/AndroidRuntime(1860):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
  08-24 02:18:01.629: E/AndroidRuntime(1860):     at dalvik.system.NativeStart.main(Native Method)
  08-24 02:18:01.629: E/AndroidRuntime(1860): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.zamani.randomizedworkout.MainScreen" on path: DexPathList[[zip file "/system/framework/android.test.runner.jar", zip file "/data/app/com.zamani.randomizedworkout-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.zamani.randomizedworkout-2, /system/lib]]
  08-24 02:18:01.629: E/AndroidRuntime(1860):     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:53)
  08-24 02:18:01.629: E/AndroidRuntime(1860):     at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
  08-24 02:18:01.629: E/AndroidRuntime(1860):     at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
  08-24 02:18:01.629: E/AndroidRuntime(1860):     at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
  08-24 02:18:01.629: E/AndroidRuntime(1860):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2128)
  08-24 02:18:01.629: E/AndroidRuntime(1860):     ... 11 more
  </code></pre>
  
  <p>Also, here is my AndroidManifest:</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.zamani.randomizedworkout"
      android:versionCode="1"
      android:versionName="1.0" &gt;
  
      &lt;uses-sdk
          android:minSdkVersion="8"
          android:targetSdkVersion="18" /&gt;
  
      &lt;instrumentation
          android:name="android.test.InstrumentationTestRunner"
          android:targetPackage="com.zamani.randomizedworkout" /&gt;
  
      &lt;application&gt;
          android:allowBackup="true"
          android:icon="@drawable/ic_launcher"
          android:label="@string/app_name"
          android:theme="@style/AppTheme" &gt;
          &lt;uses-library android:name="android.test.runner" /&gt;
          &lt;activity
              android:name="com.zamani.randomizedworkout"
              android:label="@string/app_name" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
  
          &lt;activity
              android:name="com.zamani.randomizedworkout.WorkoutScreen"
              android:label="com.zamani.randomizedworkout.MyActivityLib:string/app_name" &gt;
          &lt;/activity&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>Some additional info regarding my issue: I have included both of my activities in my AndroidManifest, which is shown above, so unless I am missing something I'm not sure that's the issue I am having. My app worked perfectly fine until I upgraded the SDK version from 17 to 18 a few days back, so maybe that is part of my problem. I've checked several other StackOverflow threads on similar issues, and I didn't find a solution that solved my problem. Any help would be greatly appreciated!</p>