title: Can't find class MainActivity (imported project)
body: <p>So I imported an android project and after struggling for a while when I was finally done, I compiled the app and it crashed.</p>
  
  <p>This is the logcat file:</p>
  
  <pre><code>07-16 23:02:23.700: E/AndroidRuntime(23092): FATAL EXCEPTION: main
  07-16 23:02:23.700: E/AndroidRuntime(23092): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{si.dvanadva.evanturist/si.dvanadva.evanturist.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "si.dvanadva.evanturist.MainActivity" on path: /data/app/si.dvanadva.evanturist-2.apk
  07-16 23:02:23.700: E/AndroidRuntime(23092):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2106)
  07-16 23:02:23.700: E/AndroidRuntime(23092):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
  07-16 23:02:23.700: E/AndroidRuntime(23092):    at android.app.ActivityThread.access$600(ActivityThread.java:141)
  07-16 23:02:23.700: E/AndroidRuntime(23092):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
  07-16 23:02:23.700: E/AndroidRuntime(23092):    at android.os.Handler.dispatchMessage(Handler.java:99)
  07-16 23:02:23.700: E/AndroidRuntime(23092):    at android.os.Looper.loop(Looper.java:137)
  07-16 23:02:23.700: E/AndroidRuntime(23092):    at android.app.ActivityThread.main(ActivityThread.java:5041)
  07-16 23:02:23.700: E/AndroidRuntime(23092):    at java.lang.reflect.Method.invokeNative(Native Method)
  07-16 23:02:23.700: E/AndroidRuntime(23092):    at java.lang.reflect.Method.invoke(Method.java:511)
  07-16 23:02:23.700: E/AndroidRuntime(23092):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
  07-16 23:02:23.700: E/AndroidRuntime(23092):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
  07-16 23:02:23.700: E/AndroidRuntime(23092):    at dalvik.system.NativeStart.main(Native Method)
  07-16 23:02:23.700: E/AndroidRuntime(23092): Caused by: java.lang.ClassNotFoundException: Didn't find class "si.dvanadva.evanturist.MainActivity" on path: /data/app/si.dvanadva.evanturist-2.apk
  07-16 23:02:23.700: E/AndroidRuntime(23092):    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
  07-16 23:02:23.700: E/AndroidRuntime(23092):    at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
  07-16 23:02:23.700: E/AndroidRuntime(23092):    at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
  07-16 23:02:23.700: E/AndroidRuntime(23092):    at android.app.Instrumentation.newActivity(Instrumentation.java:1054)
  07-16 23:02:23.700: E/AndroidRuntime(23092):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)
  </code></pre>
  
  <p>I can see from this line:</p>
  
  <pre><code>07-16 23:02:23.700: E/AndroidRuntime(23092): Caused by: java.lang.ClassNotFoundException: Didn't find class "si.dvanadva.evanturist.MainActivity" on path: /data/app/si.dvanadva.evanturist-2.apk
  </code></pre>
  
  <p>That there is a problem finding MainActivity class. But why?</p>
  
  <p>This is how I imported the project:</p>
  
  <ul>
  <li><p>Imported raw project (without libraries)</p></li>
  <li><p>Added jars to libs folder in the project</p></li>
  <li><p>Added missing build path for jars</p></li>
  <li><p>Imported three library projects (the original project detected them)</p></li>
  </ul>
  
  <p>Those three library projects are all in the same folder as the original project (in case I placed them wrong or something)</p>
  
  <p>If you need any additional info please let me know, I need to solve this problem</p>
  
  <p>Packages and their content:</p>
  
  <p><img src="https://i.stack.imgur.com/jjXck.png" alt="enter image description here"></p>
  
  <p>AndroidManifest full code:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="si.dvanadva.evanturist"
  android:versionCode="7"
  android:versionName="1.1.2" 
  android:installLocation="preferExternal"&gt;
  
  &lt;!-- ZA MAPE --&gt;
  &lt;permission
      android:name="com.dd.evanturist.permission.MAPS_RECEIVE"
      android:protectionLevel="signature"/&gt;
  &lt;uses-permission android:name="com.dd.evanturist.permission.MAPS_RECEIVE"/&gt;
  
    &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/&gt;
    &lt;uses-permission android:name="android.permission.INTERNET"/&gt;
    &lt;uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/&gt;
    &lt;!-- External storage for caching. --&gt;
    &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/&gt;
    &lt;!-- My Location --&gt;
    &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/&gt;
    &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/&gt;
    &lt;!-- Maps API needs OpenGL ES 2.0. --&gt;
    &lt;uses-feature
      android:glEsVersion="0x00020000"
      android:required="true"/&gt;
    &lt;!-- End of copy. --&gt;
  
  &lt;!-- QR STUFF --&gt;
  
  &lt;uses-permission android:name="android.permission.CAMERA"/&gt;
  &lt;uses-permission android:name="android.permission.FLASHLIGHT"/&gt;
  
  &lt;uses-sdk
      android:minSdkVersion="8"
      android:targetSdkVersion="17" /&gt;
  
  &lt;application
      android:allowBackup="true"
      android:name=".MyApplication"
      android:icon="@drawable/ic_launcher"
      android:label="@string/evanturist"
      android:theme="@style/AppTheme" &gt;
      &lt;meta-data
          android:name="com.google.android.maps.v2.API_KEY"
          android:value="AIzaSyDK5zGCwh3awW08BOAwupjU4hw8750WuLM"/&gt;
      &lt;activity
          android:name=".MainActivity"
          android:label="@string/evanturist" &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=".DBActivity"&gt;&lt;/activity&gt;
      &lt;activity android:name=".DbTestActivity"&gt;&lt;/activity&gt;
      &lt;activity android:name=".PlaceItemActivity"&gt;&lt;/activity&gt;
      &lt;activity android:name=".CheckpointsActivity"&gt;&lt;/activity&gt;
      &lt;activity android:name=".OptionsActivity"&gt;&lt;/activity&gt;
      &lt;activity android:name=".MapDirectionsActivity"&gt;&lt;/activity&gt;
      &lt;activity android:name=".VictoryActivity"&gt;&lt;/activity&gt;
      &lt;activity android:name=".QrActivity"
          android:screenOrientation="landscape"
          android:theme="@android:style/Theme.NoTitleBar.Fullscreen"&gt;&lt;/activity&gt;
      &lt;activity android:name=".QrPortraitActivity"
          android:screenOrientation="portrait" android:theme="@android:style/Theme.NoTitleBar"&gt;&lt;/activity&gt;
  
  &lt;/application&gt;
  </code></pre>
  
  <p></p>
  
  <p>Export tab at build paths:</p>
  
  <p><img src="https://i.stack.imgur.com/lZ4HK.png" alt="enter image description here"></p>