title: java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{}: java.lang.ClassNotFoundException
body: <p>I am trying to build a HelloWorld android app using cordova.
  I am following footsteps mentioned on follwoing page
  <a href="http://javaonlineguide.net/2015/06/apache-cordova-hello-world-program-for-android-platform-in-eclipse-example.html" rel="nofollow">http://javaonlineguide.net/2015/06/apache-cordova-hello-world-program-for-android-platform-in-eclipse-example.html</a></p>
  
  <p>I've been browsing the issue and I'm pretty sure I'm not having the same issues as mentioned. Both of my activities are declared in the AndroidManifest and the intent filter is there. I tried replacing in my Manifest com.example.main.MainActivity by .MainActivity but still no luck. I'm using Eclipse IDE
  In Java build path-> Order and Export 
  Android Private Libraries is checked</p>
  
  <p>I have tried building and cleaning project again and again. I even tried restarting Eclipse.</p>
  
  <p><a href="http://i.stack.imgur.com/c7Lrb.png" rel="nofollow">Project Explorer</a></p>
  
  <p>Here is Logcat:</p>
  
  <pre><code>07-14 06:07:36.169: E/AndroidRuntime(1133): FATAL EXCEPTION: main
  07-14 06:07:36.169: E/AndroidRuntime(1133): Process: com.example.main, PID: 1133
  07-14 06:07:36.169: E/AndroidRuntime(1133): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.main/com.example.main.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.example.main.MainActivity" on path: DexPathList[[zip file "/data/app/com.example.main-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.main-1, /system/lib]]
  07-14 06:07:36.169: E/AndroidRuntime(1133): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2110)
  07-14 06:07:36.169: E/AndroidRuntime(1133): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
  07-14 06:07:36.169: E/AndroidRuntime(1133): at android.app.ActivityThread.access$800(ActivityThread.java:135)
  07-14 06:07:36.169: E/AndroidRuntime(1133): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
  07-14 06:07:36.169: E/AndroidRuntime(1133): at android.os.Handler.dispatchMessage(Handler.java:102)
  07-14 06:07:36.169: E/AndroidRuntime(1133): at android.os.Looper.loop(Looper.java:136)
  07-14 06:07:36.169: E/AndroidRuntime(1133): at android.app.ActivityThread.main(ActivityThread.java:5001)
  07-14 06:07:36.169: E/AndroidRuntime(1133): at java.lang.reflect.Method.invokeNative(Native Method)
  07-14 06:07:36.169: E/AndroidRuntime(1133): at java.lang.reflect.Method.invoke(Method.java:515)
  07-14 06:07:36.169: E/AndroidRuntime(1133): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
  07-14 06:07:36.169: E/AndroidRuntime(1133): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
  07-14 06:07:36.169: E/AndroidRuntime(1133): at dalvik.system.NativeStart.main(Native Method)
  07-14 06:07:36.169: E/AndroidRuntime(1133): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.main.MainActivity" on path: DexPathList[[zip file "/data/app/com.example.main-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.main-1, /system/lib]]
  07-14 06:07:36.169: E/AndroidRuntime(1133): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
  07-14 06:07:36.169: E/AndroidRuntime(1133): at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
  07-14 06:07:36.169: E/AndroidRuntime(1133): at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
  07-14 06:07:36.169: E/AndroidRuntime(1133): at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
  07-14 06:07:36.169: E/AndroidRuntime(1133): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2101)
  </code></pre>
  
  <p>Here is AndroidManifest.xml :</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.example.main"
  android:hardwareAccelerated="true"
  android:versionCode="1"
  android:versionName="0.0.1" &gt;
  
  &lt;supports-screens
      android:anyDensity="true"
      android:largeScreens="true"
      android:normalScreens="true"
      android:resizeable="true"
      android:smallScreens="true"
      android:xlargeScreens="true" /&gt;
  
  &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  
  &lt;application
      android:hardwareAccelerated="true"
      android:icon="@drawable/icon"
      android:label="@string/app_name"
      android:supportsRtl="true" &gt;
      &lt;activity
          android:name="MainActivity"
             android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale"
          android:label="@string/activity_name"
          android:launchMode="singleTop"
          android:theme="@android:style/Theme.DeviceDefault.NoActionBar"
          android:windowSoftInputMode="adjustResize" &gt;
          &lt;intent-filter android:label="@string/launcher_name" &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;/application&gt;
  
  &lt;uses-sdk
      android:minSdkVersion="14"
      android:targetSdkVersion="23" /&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>Here is MainActivity.java</p>
  
  <pre><code>package com.example.main;
  
  import android.os.Bundle;
  import org.apache.cordova.*;
  
  public class MainActivity extends CordovaActivity
  {
      @Override
      public void onCreate(Bundle savedInstanceState)
      {
          super.onCreate(savedInstanceState);
          // Set by &lt;content src="index.html" /&gt; in config.xml
          loadUrl(launchUrl);
      }
  }
  </code></pre>