Android Project Suddenly Ruined, Can't Find R Object
Solution 1:
Do Project -> Clean for a few times.
And then Build the project.
If you still cant find R.java
in the gen
folder, check if you have ANY errors in your layout
files, for example check if all your xml files
and drawables
are named only in lower-case letters.
After removing these errors, Clean and Build once again.
Solution 2:
Simply remove import android.R
and it will work.
Solution 3:
The above answer states it clearly. Take a look at your layout files and a hint from me: When I filled by strings.xml file, I found out, that when copying some colors there, I closed the tag with a tag. This is easily overlooked thing and i intend of writing a class which detects this, because apparently this isn't going to be fixed anytime soon (by fixed I mean at least a notification for us).
Solution 4:
- clean the project by selecting Project - Clean
- if
R.java
is not created, delete the gen folder, then re-create it manually, right-click, Build Path - use as source folder, rebuild the project - if
R.java
is still not there, there is a probability that some of your XML files contain errors, check that - in case your project's origin is an svn repository, there might be some invisible config files which the compiler does not recognize. Right-click your project - Properties - Resources - Resource filters - add- exlude all - files and folders - name matches .svn
- in case you downloaded and imported your project, check the target (SDK) and mare sure you have the required packages installed.
Post a Comment for "Android Project Suddenly Ruined, Can't Find R Object"