0

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

Leigh
  • 28,765
  • 10
  • 55
  • 103
rayandrew
  • 23
  • 1
  • 4
  • Welcome to Stack Overflow! When possible, it is best to include code/error details within the question, rather than linking to an external site. (Since the error was relatively small, I pasted it above) – Leigh May 24 '13 at 19:38

2 Answers2

2

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.

Community
  • 1
  • 1
thiagolr
  • 6,909
  • 6
  • 44
  • 64
  • While those links may contain an answer, it is best to include a brief summary as well. So your answer will still be useful to others if those links change or break. (Edit: Thank you!) – Leigh May 24 '13 at 19:29
0

Which version of java you are using? Try to update your JDK to 1.7 and let us know if that helps. You could also try the suggestions in this link to help troubleshoot your problem.

Leigh
  • 28,765
  • 10
  • 55
  • 103
Alpesh
  • 265
  • 2
  • 7
  • 22