Cleanup project does not fix R.java errors (Android)

My Android project just started saying that all my R.blah.blah links are errors. Clearing / re-creating the R.java file did not fix it. Does not close / does not open the project / eclipse. I disabled any changes to the xml files that might have caused it. This happens only in ONE of my actions, all other actions have no errors related to R.blah.

Note: R.java has all the correct links in the file.

+5
source share
6 answers

check if

import android.R;

is in your classes and removes it then try

+2
source

If you copy code from another project, you get some lines, such as

import android.R.com.example.view.Widget
import android.R.com.hardware.Camera 

.

+1

, eclipse. . . Viola.it . xml (, xml ). .

+1

xml. xml . , .. , R.java .

0

,

    import your_package_name.R;
0

The string android:text="@string/Get Location"causes an error in R.java because the string Get Locationhas a space in it.

To fix this, use the underscore between the two names: Get_Location

0
source

All Articles