title: Android to Unable to instantiate Application java.lang.ClassNotFoundException:
body: <p>I am working on application which is host on android market. Sometimes (once a month ) I got a crash report:</p>
  
  <blockquote>
    <p>Unable to instantiate application java.lang.ClassNotFoundException</p>
  </blockquote>
  
  <p>App downloads are between 10,000-50,000. I don't know why this exceptions raise on some devices not all ( I tested it on 3 different devices &amp; I couldn't re-produce it at my end).</p>
  
  <p>I read articles/suggestions on different android forums regarding the issue but I didn't succeed in solving it. Does anyone face similar issue &amp; suggest me what should I do?</p>
  
  <p><strong>Note:</strong>
  I am extending application class like this</p>
  
  <pre><code>public class MyApplication extends Application {
  
  }
  </code></pre>
  
  <p>I register it in the manifest.xml like this</p>
  
  <pre><code>&lt;application android:icon="@drawable/app_icon"
      android:label="@string/my_app_name" android:name="MyApplication"&gt;
  </code></pre>
  
  <p><strong>Stack Trace :</strong></p>
  
  <pre><code>java.lang.RuntimeException: Unable to instantiate application  com.xyz.MyApplication      java.lang.ClassNotFoundException: com.xyz.MyApplication in loader dalvik.system.PathClassLoader[/mnt/asec/com.xyz-1/pkg.apk]
  at android.app.ActivityThread$PackageInfo.makeApplication(ActivityThread.java:650)
  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4238)
  at android.app.ActivityThread.access$3000(ActivityThread.java:126)
  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2076)
  at android.os.Handler.dispatchMessage(Handler.java:99)
  at android.os.Looper.loop(Looper.java:123)
  at android.app.ActivityThread.main(ActivityThread.java:4633)
  at java.lang.reflect.Method.invokeNative(Native Method)
  at java.lang.reflect.Method.invoke(Method.java:521)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
  at dalvik.system.NativeStart.main(Native Method)
  Caused by: java.lang.ClassNotFoundException: com.xyz.MyApplication in loader dalvik.system.PathClassLoader[/mnt/asec/com.xyz-1/pkg.apk]
  at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
  at android.app.Instrumentation.newApplication(Instrumentation.java:942)
  at android.app.ActivityThread$PackageInfo.makeApplication(ActivityThread.java:645)
  </code></pre>
  
  <p>I don't know why application crash on some devices not all. </p>