Hello Android "No such file or directory"
I got an error today trying to run the Hello World android application Hello, Android:
com/example/helloandroid/R.java: No such file or directory
Because all I could find online was a single tweet written in Spanish mentioning the error, I will tell you that upgrading Java and restarting my computer seems to have fixed it. I'm using Eclipse on Mac OS 10.5, building against the 2.1 Android SDK. Hope this can help someone.
Update: I saw a similar error again in a later project. The R.java file was not being automatically populated correctly with UI elements. The reason was because my activity class was importing R.java (which I guess happened after doing cmd-shift-o to auto-import all needed classes). Removing the import statement and from my activity class and cleaning the project (Project > Clean) fixed this.
References