I’m posting this because it took me ages to fix and I could find no tips on-line.
I hope my question and answer helps a similarly afflicted person.
When launching, my app crashed and in the Eclipse LogCat it showed an AndroidRuntime Error saying it was:
Unable to instantiate activity - java.lang.ClassNotFoundException
Somehow , my main activity was not being uploaded to the android device and I could not work out why not.
I’m not sure if it is relevant but I am building the calendar-android-sample from google.
Answering my own question:
Somehow the source output folders in my eclipse build path were setup wrongly.
Looking in Project>Properties>Java Build Path>Source Tab :
The default output directory (bin/classes) had been overridden for the most important source folder(ie src/main/java). It was configured to use target/classes as the output folder (shown below):
So this was causing my source classes to be created under the target folder (although since they are not shown under package explorer I had to use navigator to spot them).
Anyhow, I removed the check from the box highlighted in red above. This caused all output folders to align to the default and my source classes were created under bin/classes (again I had to use navigator instead of package explorer to check they were there).
Then when I did a launch all my classes got downloaded to the android device and I had no runtime errors.
I hope this helps someone.
Regards, Peter