0

when i add or update a dependency in app gradle class R will not find in my activity class.

 "android cannot resolve symbol R" 

enter image description here

mohammadReza Abiri
  • 1,679
  • 1
  • 7
  • 20

2 Answers2

2

Top yellow bar has a function "Sync now". You can click it and it will sync the Gradle files.

If this doesn't work you can try

Build > Clean Project

Build > Rebuild Project

You can also try

File > Sync Project with Gradle Files

Beasteca
  • 83
  • 9
  • 1
    In a case like this question please close the question against the canonical duplicate. – jww Oct 22 '18 at 13:26
0

I had this this issue too. A simple 'gradlew clean' and 'gradlew build' did the trick.

Click on Build->Clean Project and that will perform a gradle clean

VIISHRUT MAVANII
  • 10,281
  • 5
  • 31
  • 46
  • 1
    In a case like this question please close the question against the canonical duplicate. – jww Oct 22 '18 at 13:26