0

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 ?

MS Tabrez
  • 5
  • 3

1 Answers1

1

R is an auto generate file.Problems occur if it does not generate or you did not reference to it correctly:

  1. It may be caused if a file name in your /res folder be invalid;so R does not generate.

  2. It may raised if you try to reference to R in a package that is not main package.

  3. In your imports of your class,you may see import android.R; change it to import your.package.name.R;

  4. It may be caused by an error in your resources.For example an error in XML layout or strings file.

  5. 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.

Community
  • 1
  • 1
hasanghaforian
  • 13,858
  • 11
  • 76
  • 167