title: Android ClassNotFoundException: Didn't find class on path dexpath unity plugin
body: <p>I am creating a unity plugin in android studio. However I am stuck on this particular exception.</p>
  
  <p>The problem does not occur when I compile and run the project as an application and happens only when it is exported as a library to unity. </p>
  
  <p>Here is the full Log cat of the error </p>
  
  <pre><code>com.livefurnish.livefurnish E/AndroidRuntime: FATAL EXCEPTION: main
  Process: com.livefurnish.livefurnish, PID: 28640
  java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.livefurnish.livefurnish/com.livefurnish.livefurnish.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.livefurnish.livefurnish.MainActivity" on path: DexPathList[[zip file "/data/app/com.livefurnish.livefurnish-2/base.apk"],nativeLibraryDirectories=[/data/app/com.livefurnish.livefurnish-2/lib/arm, /system/fake-libs, /data/app/com.livefurnish.livefurnish-2/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]
      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2567)
      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
      at android.app.ActivityThread.-wrap12(ActivityThread.java)
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
      at android.os.Handler.dispatchMessage(Handler.java:102)
      at android.os.Looper.loop(Looper.java:154)
      at android.app.ActivityThread.main(ActivityThread.java:6126)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
  Caused by: java.lang.ClassNotFoundException: Didn't find class "com.livefurnish.livefurnish.MainActivity" on path: DexPathList[[zip file "/data/app/com.livefurnish.livefurnish-2/base.apk"],nativeLibraryDirectories=[/data/app/com.livefurnish.livefurnish-2/lib/arm, /system/fake-libs, /data/app/com.livefurnish.livefurnish-2/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]
      at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
      at android.app.Instrumentation.newActivity(Instrumentation.java:1079)
      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2557)
      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726) 
      at android.app.ActivityThread.-wrap12(ActivityThread.java) 
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477) 
      at android.os.Handler.dispatchMessage(Handler.java:102) 
      at android.os.Looper.loop(Looper.java:154) 
      at android.app.ActivityThread.main(ActivityThread.java:6126) 
      at java.lang.reflect.Method.invoke(Native Method) 
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) 
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) 
  Suppressed: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/api/GoogleApiClient$OnConnectionFailedListener;
      at java.lang.VMClassLoader.findLoadedClass(Native Method)
      at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:742)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:362)
              ... 12 more
  Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.common.api.GoogleApiClient$OnConnectionFailedListener" on path: DexPathList[[zip file "/data/app/com.livefurnish.livefurnish-2/base.apk"],nativeLibraryDirectories=[/data/app/com.livefurnish.livefurnish-2/lib/arm, /system/fake-libs, /data/app/com.livefurnish.livefurnish-2/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]
      at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
              ... 15 more
  </code></pre>
  
  <p>And here is the custom manifest that I am using for the plugin in unity:</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.livefurnish.livefurnish"  android:versionName="1.0" android:versionCode="1"&gt;
  &lt;uses-sdk android:minSdkVersion="19" /&gt;
      &lt;application android:label="@string/app_name"&gt;
          &lt;activity android:name=".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;
      &lt;/application&gt;
  &lt;/manifest&gt;
  </code></pre>
  
  <p>I found and tried many solutions for this on the internet, However none of them addresses the case when the application is compiled as a unity plugin.</p>