title: java.lang.RuntimeException: Unable to instantiate application
body: <p>In Google Play Developer Console I see this crash:</p>
  
  <pre><code>java.lang.RuntimeException: Unable to instantiate application com.example.MyApp: java.lang.ClassNotFoundException: Didn't find class "com.example.MyApp" on path: DexPathList[[zip file "/mnt/asec/com.example.testapp-1/pkg.apk"],nativeLibraryDirectories=[/mnt/asec/com.example.testapp-1/lib, /vendor/lib, /system/lib]]
  at android.app.LoadedApk.makeApplication(LoadedApk.java:516)
  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4545)
  at android.app.ActivityThread.access$1500(ActivityThread.java:160)
  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1390)
  at android.os.Handler.dispatchMessage(Handler.java:110)
  at android.os.Looper.loop(Looper.java:193)
  at android.app.ActivityThread.main(ActivityThread.java:5330)
  at java.lang.reflect.Method.invokeNative(Native Method)
  at java.lang.reflect.Method.invoke(Method.java:515)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:829)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:645)
  at dalvik.system.NativeStart.main(Native Method)
  Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.MyApp" on path: DexPathList[[zip file "/mnt/asec/com.example.testapp-1/pkg.apk"],nativeLibraryDirectories=[/mnt/asec/com.example.testapp-1/lib, /vendor/lib, /system/lib]]
  at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
  at android.app.Instrumentation.newApplication(Instrumentation.java:975)
  at android.app.LoadedApk.makeApplication(LoadedApk.java:511)
  ... 11 more
  Suppressed: java.io.IOException: unable to open DEX file
  at dalvik.system.DexFile.openDexFileNative(Native Method)
  at dalvik.system.DexFile.openDexFile(DexFile.java:296)
  at dalvik.system.DexFile.&lt;init&gt;(DexFile.java:80)
  at dalvik.system.DexFile.&lt;init&gt;(DexFile.java:59)
  at dalvik.system.DexPathList.loadDexFile(DexPathList.java:263)
  at dalvik.system.DexPathList.makeDexElements(DexPathList.java:230)
  at dalvik.system.DexPathList.&lt;init&gt;(DexPathList.java:112)
  at dalvik.system.BaseDexClassLoader.&lt;init&gt;(BaseDexClassLoader.java:48)
  at dalvik.system.PathClassLoader.&lt;init&gt;(PathClassLoader.java:65)
  at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:57)
  at android.app.LoadedApk.getClassLoader(LoadedApk.java:326)
  at android.app.LoadedApk.makeApplication(LoadedApk.java:508)
  ... 11 more
  </code></pre>
  
  <p>This crash occurs mostly on Android versions 4.4 and 4.2.
  <a href="https://stackoverflow.com/a/10158241">This answer</a> suggests that this crash occurs when the apk is updated by dalvik. It seems to be a <a href="https://code.google.com/p/android/issues/detail?id=56296" rel="nofollow noreferrer">low-priority Android bug</a>.</p>
  
  <p>Are there any workarounds for this?
  Does it help to set   </p>
  
  <pre><code> &lt;application        
          android:allowBackup="false"
  </code></pre>
  
  <p>in Manifest.xml?</p>
  
  <p>(Maybe the backup of application is stored on SD-card, which is causing the problem on apk update).</p>