title: Android ClassNotFoundException for main activity
body: <p>I can't get my app to launch because it can't find my MainActivity, even though I have the proper .java file and I declared in my manifest, as you can see below:</p>
  
  <pre><code>&lt;application
      android:allowBackup="true"
      android:icon="@drawable/ic_launcher"
      android:label="@string/app_name"
      android:theme="@style/AppTheme"&gt;
      &lt;activity
          android:name="com.rakeshdas.smsblocker.MainActivity"
          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;
  </code></pre>
  
  <p><em>EDIT</em> The logcat is below and it says that it cannot find the class <em>MainActivity</em>:</p>
  
  <pre><code> --------- beginning of crash
  12-19 19:43:01.184      931-931/com.rakeshdas.smsblocker E/AndroidRuntime﹕ FATAL EXCEPTION: main
  Process: com.rakeshdas.smsblocker, PID: 931
  java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.rakeshdas.smsblocker/com.rakeshdas.smsblocker.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.rakeshdas.smsblocker.MainActivity" on path: DexPathList[[zip file "/data/app/com.rakeshdas.smsblocker-2/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
          at android.app.ActivityThread.access$800(ActivityThread.java:144)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
          at android.os.Handler.dispatchMessage(Handler.java:102)
          at android.os.Looper.loop(Looper.java:135)
          at android.app.ActivityThread.main(ActivityThread.java:5221)
          at java.lang.reflect.Method.invoke(Native Method)
          at java.lang.reflect.Method.invoke(Method.java:372)
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:898)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693)
   Caused by: java.lang.ClassNotFoundException: Didn't find class "com.rakeshdas.smsblocker.MainActivity" on path: DexPathList[[zip file "/data/app/com.rakeshdas.smsblocker-2/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
          at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
          at android.app.Instrumentation.newActivity(Instrumentation.java:1065)
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2199)
          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
          at android.app.ActivityThread.access$800(ActivityThread.java:144)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
          at android.os.Handler.dispatchMessage(Handler.java:102)
          at android.os.Looper.loop(Looper.java:135)
          at android.app.ActivityThread.main(ActivityThread.java:5221)
          at java.lang.reflect.Method.invoke(Native Method)
          at java.lang.reflect.Method.invoke(Method.java:372)
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:898)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693)
  Suppressed: java.lang.NoClassDefFoundError: com.rakeshdas.smsblocker.MainActivity
          at dalvik.system.DexFile.defineClassNative(Native Method)
          at dalvik.system.DexFile.defineClass(DexFile.java:226)
          at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:219)
          at dalvik.system.DexPathList.findClass(DexPathList.java:321)
          at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:54)
          ... 14 more
  Suppressed: java.lang.ClassNotFoundException: com.rakeshdas.smsblocker.MainActivity
          at java.lang.Class.classForName(Native Method)
          at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
          at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
          ... 13 more
   Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
  </code></pre>