Cannot find the symbol class R even after adding import com.example.app.R;

1.6k Views Asked by At

I am using IntelliJ IDEA and i tried to build my android application and it was giving an error saying 'Cannot find the symbol class R' at all the places where I used R in the code. I already included 'import com.example.app.R' line in all the classes and the code is all correct and showing no errors. I also checked File->Project Structure->Modules and both gen and src are included as sources. Help me fix this.

1

There are 1 best solutions below

0
On

Could you please try this way

File-> Invalidat Caches/Restart and then click on the Invalidate and Restart button.

Sometimes, it takes from the cache and screws up the operation, restarting and invalidating cache mostly works, please try out and inform.