I am a new Android developer (4 weeks to port my iPhone application to Android). I have 8 projects (application and 6 small experiments with the user interface) and the Hello World Hello project that I just created using Eclipse. All do not compile, and the problem is that each link to the generated R file is marked as "R cannot be resolved by a variable."
Until yesterday, each project was compiled and launched (albeit very slowly) in the Android emulator. I changed something, and from yesterday all projects will not compile, everything is exactly the same "R cannot be resolved by a variable". In each case, the generated files are missing. I believe that they disappeared when I tried to clean and rebuild every project while debugging this problem.
Two things that, as I know, changed when this problem started, but I canβt say that it caused the problem: 1) switching to debugging on a real Android device (Samsung Galaxy Tab 2, which worked as a champion after struggling with slow emulators) and 2) allows Android (and possibly Eclipse) to update itself from the Internet.
I spent many hours trying other user suggestions, and no one helped. Most of the suggestions relate to problems with file names, xml syntax errors, but I did not change these files and file names since the compilation worked. I tried:
- project cleaning and restoration
- Check for subsequent updates to the Android SDK (as well as the next two)
- Eclipse-> File-> Android Tools-> Fix Project Properties
- creating small initial changes for a forced rebuild.
- reboot Eclipse as well as Mac host, adb, emulator, Android SDK Manager
- deleting the project, restarting Eclipse and adding the project back (a bad idea is a failure with an error) Failed to load the properties file for the project "ListViewFragmentTest"
- creating a new Android App project that worked many times before, but now does not work
Something is happening systematically wrong there, and until I demand that all of these projects be error-free, they worked until 18:00 yesterday, and then everyone stopped compiling after that.
I wonder if anyone has any other suggestions before I proceed to completely reinstall the development environment?
My environment:
- Macbook Pro (OS X 10.7.5, 8 GB RAM, 2.53GHx Core i5)
- Eclipse (Indigo Service Release 2, Build: 20120216-1857) (too old?)
- Android SDK Manager Rev 22
- Android SDK Tools (22), platform tools (17), build tools (17)
- API 11-17, all updated
It seems that many people are experiencing problems with missing generated (R) files, and I had problems when I also had layouts of XML errors, but this does not seem to cause this problem. Thanks in advance for your help!
source share