-3

in my project for build calculate has error like this :

void findView(){

        btn_0=(Button)findViewById(R.id.btn_0);
           btn_1=(Button)findViewById(R.id.btn_1);

and cannot resolve symbol for anythings have R ,what should i do ?

4 Answers4

0

Go to your top nav bar --> Build -- > Clean project --> Rebuild project.

Martin Lund
  • 1,159
  • 9
  • 17
0

if you are using gradle as your build tool, the problem is that the gradle is not synced with your project. and keep in mind that if you are developing in a restricted country, try using a proxy while syncing the gradle.

A.Shaheri
  • 450
  • 4
  • 13
0

i think gradle is not synced with your project. that's why it giving error that cannot resolve symbol for anythings have R

and R is autogenerated and contains all IDs from your controls of layouts

so Build -- > Clean project --> Rebuild project.

enter image description here

to clean project

enter image description here

AskNilesh
  • 67,701
  • 16
  • 123
  • 163
0

Build -- > Clean project --> Rebuild project and run your project again

Vishal Vaishnav
  • 3,346
  • 3
  • 26
  • 57