title: Android - Unable to instantiate activity
body: <p>I'm currently using Android Studio to develop my own project for Android (my custom launcher)! The thing is, since last update (to version 0.4.0) I can't run my app.</p>
  
  <p>Instead I get the following error:</p>
  
  <pre><code>FATAL EXCEPTION: main
      java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.natercio.myhome/com.natercio.myhome.Launcher}: java.lang.ClassNotFoundException: Didn't find class "com.natercio.myhome.Launcher" on path: DexPathList[[zip file "/data/app/com.natercio.myhome-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.natercio.myhome-2, /system/lib]]
              at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2137)
              at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
              at android.app.ActivityThread.access$600(ActivityThread.java:141)
              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
              at android.os.Handler.dispatchMessage(Handler.java:99)
              at android.os.Looper.loop(Looper.java:137)
              at android.app.ActivityThread.main(ActivityThread.java:5103)
              at java.lang.reflect.Method.invokeNative(Native Method)
              at java.lang.reflect.Method.invoke(Method.java:525)
              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
              at dalvik.system.NativeStart.main(Native Method)
       Caused by: java.lang.ClassNotFoundException: Didn't find class "com.natercio.myhome.Launcher" on path: DexPathList[[zip file "/data/app/com.natercio.myhome-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.natercio.myhome-2, /system/lib]]
              at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:53)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
              at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
              at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2128)
              at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
              at android.app.ActivityThread.access$600(ActivityThread.java:141)
              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
              at android.os.Handler.dispatchMessage(Handler.java:99)
              at android.os.Looper.loop(Looper.java:137)
              at android.app.ActivityThread.main(ActivityThread.java:5103)
              at java.lang.reflect.Method.invokeNative(Native Method)
              at java.lang.reflect.Method.invoke(Method.java:525)
  </code></pre>
  
  <p>I've searched everywhere I could remember for a solution (or something related) and tried a bunch of stuff already without any success.</p>
  
  <ul>
  <li>check the "compiler.xml" (there are no excludes)</li>
  <li>clean/build (error persists)</li>
  <li>check the "AndroidManifest.xml" (everything seems correct)</li>
  <li>recreated the whole project (only imported the code and the resources but the error persists)</li>
  </ul>
  
  <p>One thing I did notice in this line</p>
  
  <pre><code>Caused by: java.lang.ClassNotFoundException: Didn't find class "com.natercio.myhome.Launcher" on path: DexPathList[[zip file "/data/app/com.natercio.myhome-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.natercio.myhome-2, /system/lib]]
  </code></pre>
  
  <p>is that there is an "-2" (and sometimes a "-1") appended to the name of the app (both in the apk file and in the lib path) but I never really noticed this before so I can't tell for sure if this is somehow related with my problem.</p>
  
  <p>Please also take in consideration that I use git and I've already tried to revert any changes to one of my previously stable commits.</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>Has anyone else encountered this problem in Android Studio? Is there any other solution to this kind of error that I missed or is this likely to be some bug in the latest android plugin (for android studio).</p>
  
  <p><strong>UPDATE (build.gradle &amp; manifest file):</strong></p>
  
  <p>build.gradle:</p>
  
  <pre><code>buildscript {
      repositories {
          mavenCentral()
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:0.7.+'
      }
  }
  apply plugin: 'android'
  
  repositories {
      mavenCentral()
  }
  
  android {
      compileSdkVersion 18
      buildToolsVersion '18.1.1'
  
      defaultConfig {
          minSdkVersion 15
          targetSdkVersion 19
          versionCode 1
          versionName "1.0"
      }
  
      compileOptions {
          sourceCompatibility JavaVersion.VERSION_1_7
          targetCompatibility JavaVersion.VERSION_1_7
      }
      buildTypes {
          release {
              runProguard false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
          }
      }
  }
  
  dependencies {
      compile 'com.android.support:support-v4:+'
      compile 'com.android.support:support-v13:+'
      compile 'com.j256.ormlite:ormlite-android:4.47'
  }
  </code></pre>
  
  <p>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.natercio.myhome"
            android:versionName="@string/app_version_name"&gt;
  
      &lt;uses-sdk android:targetSdkVersion="17"
                android:minSdkVersion="15"/&gt;
  
      &lt;uses-permission android:name="android.permission.SET_WALLPAPER"/&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
  
      &lt;application
              android:icon="@drawable/ic_launcher"
              android:label="@string/app_name"
              android:theme="@style/Theme.Launcher"&gt;
  
          &lt;service android:name=".profiler.ProfilerService"
                   android:exported="false"/&gt;
  
          &lt;activity android:name=".Launcher"
                    android:screenOrientation="portrait"
                    android:launchMode="singleTask"
                    android:description="@string/app_description"&gt;
  
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN"/&gt;
                  &lt;category android:name="android.intent.category.HOME"/&gt;
                  &lt;category android:name="android.intent.category.DEFAULT"/&gt;
              &lt;/intent-filter&gt;
  
          &lt;/activity&gt;
  
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>