'Cannot Resolve Symbol 'R' Android Studio 3.0
My app was working normally. When I went to sleep I left the PC on and the next morning I found this error in the R: can not resolve symbol
... Try everything, build, even from the gradle and nothing works
When I try to clean up, it throws me a lot of errors, the same is with build and build APK (s)
Solution 1:[1]
Happened to me also after updating Studio and Gradle version. Even when the problem is in resource files, sometimes it might fail to indicate that. In such a scenario just close the project and import it afresh. That worked for me. The answers and comments in this question provide more details: https://stackoverflow.com/a/49537464/1877184
Solution 2:[2]
You have some problem in your resource file, particularly in layouts ,color files or styles. if you have any old backup you have to compare both or try to find out where it have a problem...
Solution 3:[3]
What solved my problem was:
1. Update Android Studio to the latest version
2. Update all the SDK as well
UPDATE
I finally found the answer on why the above works, it has to do with your build tools version. Upgrading the SDK seems to update my build tools.
To solve:
File > Project Structure > Project
Make sure that you are not using Android Plugin
which has -alpha
or -beta
. What works for me was 3.0.1
version
Another Possibility
Also make sure that all your .xml files are correct. Check every single file, and make sure that Android Studio has no complaint. I had a missing @string
value
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Musili |
Solution 2 | Raja |
Solution 3 |