Reputation: 5
i am trying to run my program but facing an error problem.it is indicating an error sign under the R of my reference statement. what are the facts that can create this kind of errors ?
Upvotes: 0
Views: 42
Reputation: 14032
R
is an auto generate file.Problems occur if it does not generate or you did not reference to it correctly:
It may be caused if a file name in your /res folder be invalid;so R does not generate.
It may raised if you try to reference to R
in a package that is not main package.
In your imports of your class,you may see import android.R;
change it to import your.package.name.R;
It may be caused by an error in your resources.For example an error in XML layout or strings file.
You can do closing and reopening your project or going to >Project > Build all (and selecting "Build Automatically").It may be fix the problem.
It is recommended to see R cannot be resolved - Android error.
Upvotes: 1