Search code examples
androidforceclose

Application Force Close after update sdk


I have updated my android sdk from r21 to r22. I also updated the adt. Before the updates, my application work perfectly without error and force close. But now, all of my apps are force close when run via avd or real phone. I don't know the problem, but, it seems that the compiler didn't found my MainActivity class. I have already checked it many times, and I'm sure that my MainActivity doesn't have any error and compile properly.

Here's the logcat error:

05-25 01:11:02.931: E/AndroidRuntime(7724): FATAL EXCEPTION: main
05-25 01:11:02.931: E/AndroidRuntime(7724): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{ca.slim.social/ca.slim.social.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "ca.slim.social.MainActivity" on path: /data/app/ca.slim.social-2.apk
05-25 01:11:02.931: E/AndroidRuntime(7724):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2223)
05-25 01:11:02.931: E/AndroidRuntime(7724):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2357)
05-25 01:11:02.931: E/AndroidRuntime(7724):     at android.app.ActivityThread.access$600(ActivityThread.java:153)
05-25 01:11:02.931: E/AndroidRuntime(7724):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1247)
05-25 01:11:02.931: E/AndroidRuntime(7724):     at android.os.Handler.dispatchMessage(Handler.java:99)
05-25 01:11:02.931: E/AndroidRuntime(7724):     at android.os.Looper.loop(Looper.java:137)
05-25 01:11:02.931: E/AndroidRuntime(7724):     at android.app.ActivityThread.main(ActivityThread.java:5224)
05-25 01:11:02.931: E/AndroidRuntime(7724):     at java.lang.reflect.Method.invokeNative(Native Method)
05-25 01:11:02.931: E/AndroidRuntime(7724):     at java.lang.reflect.Method.invoke(Method.java:511)
05-25 01:11:02.931: E/AndroidRuntime(7724):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
05-25 01:11:02.931: E/AndroidRuntime(7724):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:561)
05-25 01:11:02.931: E/AndroidRuntime(7724):     at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:106)
05-25 01:11:02.931: E/AndroidRuntime(7724):     at dalvik.system.NativeStart.main(Native Method)
[tpb]05-25 01:11:02.931: E/AndroidRuntime(7724): Caused by: java.lang.ClassNotFoundException: Didn't find class "ca.slim.social.MainActivity" on path: /data/app/ca.slim.social-2.apk[/tpb]
05-25 01:11:02.931: E/AndroidRuntime(7724):     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
05-25 01:11:02.931: E/AndroidRuntime(7724):     at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
05-25 01:11:02.931: E/AndroidRuntime(7724):     at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
05-25 01:11:02.931: E/AndroidRuntime(7724):     at android.app.Instrumentation.newActivity(Instrumentation.java:1054)
05-25 01:11:02.931: E/AndroidRuntime(7724):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2214)
05-25 01:11:02.931: E/AndroidRuntime(7724):     ... 12 more

NB: I'm using actionbarsherlock, slidingmenu, and viewpagerindicator.

Thank You


Solution

  • Lots of people are having this issue!

    Try these solutions:

    ClassNotFoundException after ADT update

    Try going to Project -> Properties -> Java Build Path -> Order & Export and ensure Android Private Libraries are checked for your project and for all other library projects you are using. Clean all projects afterwards and see what happens.


    Eclipse giving error, missing R.java file after recent update

    After updating to SDK Tools to rev. 22 for the first time, you may need to relaunch Android SDK Manager again and install a new item: Android SDK Build-tools.