This is a big mystery to me. When working on Android Project with Eclipse, after a period of time, the Eclipse workspace would become corrupt for whatever reason. It will then ask me to create a new workspace. Fine! I did that, and re-import all my project. I need to do it one by one.  It’s super annoying. So, I did that too.

Now eclipse is reporting error on ALL overridden method.

“The method onClick(DialogInterface, int) of type new DialogInterface.OnClickListener(){} must override a superclass method.

1 quick fix available: Remove ‘@Override’ annotation.

If you remove the annotation, yes it would work again. Super annoying.

I researched on Google, and it seems like this is a compiler version issue. But all the solution I tried doesn’t work. I finally got it to work after some time.

These are several things I did to get it to work:

  • Change compiler version: Click on Project menu item > Properties >  Java Compiler to version 1.6. If it’s already at 1.6, change it to 1.5, anc click apply. It will recompile everything. Change the compiler back to 1.6, and apply it again.
  • right click on your project > Android Tools > Fix Project Properties
  • Click on Project menu item > uncheck Build Automatically. Click Project again, and Clean. Check Build Automatically again.
  • Pull your hair, your co workers’ hair, go out of your office, find som e guy with at least some hair, and pull his too.

I guess I’m spoiled with Visual Studio.

PS: Option 4 above is NOT recommended. Particularly if it involves hair that isn’t yours!!