title: Android app ClassNotFoundException for main activity
body: <p>Most of the devices can run my app but I got this error report :</p>
  
  <pre><code>java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.company.app/com.company.app.MainActivity}: java.lang.ClassNotFoundException: com.company.app.MainActivity in loader dalvik.system.PathClassLoader[/mnt/asec/com.company.app-1/pkg.apk]
  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2755)
  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2854)
  at android.app.ActivityThread.access$2300(ActivityThread.java:136)
  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2179)
  at android.os.Handler.dispatchMessage(Handler.java:99)
  at android.os.Looper.loop(Looper.java:143)
  at android.app.ActivityThread.main(ActivityThread.java:5068)
  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.company.app.MainActivity in loader dalvik.system.PathClassLoader[/mnt/asec/com.company.app-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.newActivity(Instrumentation.java:1034)
  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2747)
  ... 11 more
  </code></pre>
  
  <p>I found there is a related answer:
  <a href="https://stackoverflow.com/questions/3090009/classnotfoundexception-android">ClassNotFoundException Android</a></p>
  
  <p>but the question is, my exception occurs before any line of code i write, so how can I ensure the class loader is loaded?</p>