0

I'm developing an android application for a month. and today when I cleaned my project (project>clean...), I got "R cannot be resolved to a variable" error and i can't run my app.

I Googled for solution and did every solution for this problem but not success.

Note: I removed all imports R and cleaned my project again but the problem exists.

Can anyone help me?

Sorry for bad English!

Edit: problem solved. there was some errors in one of xml files.

Ali.M
  • 301
  • 6
  • 24
  • Do you have any other problems/errors in your project? Try to fix them, these can prevent the R file from generating. (Also, you need to import your own R, like com.myapp.example.R) – nhaarman Aug 01 '11 at 11:47
  • right click on the project and click buildpath – Randroid Aug 01 '11 at 11:48
  • 4
    Answered here http://stackoverflow.com/questions/885009/r-cannot-be-resolved-android-error – Fiacc Aug 01 '11 at 11:48
  • added 'import .R' and cleaned again. and I have not other errors. all errors are about R variable! – Ali.M Aug 01 '11 at 11:55
  • sorry guys. problem solved. there was an error in one of xml layout files. – Ali.M Aug 01 '11 at 12:15

2 Answers2

2

this appears when you have errors in layout files or other xml files. Also take care that images have names that don t contain upper caracters

Raluca Lucaci
  • 1,968
  • 2
  • 19
  • 37
0

I solved my problem

LinearLayout android:id="@id/TelNoLayout" 

replace to

LinearLayout android:id="@+id/TelNoLayout"

and build

Uri Agassi
  • 36,078
  • 12
  • 73
  • 92
Serkan
  • 1