3

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)

A big lot of errors

Rinav
  • 2,527
  • 8
  • 33
  • 55
M.Argumedo
  • 181
  • 1
  • 3
  • 9
  • check the value-v26 file maybe u misspelled a name or something this happens usualy to me when i forget the + in @+id not sure for you – Mohammad Tabbara Nov 30 '17 at 12:35
  • Did you try to sync Gradle files? In your java import statements remove the import for R, and then Rebuild project. After that import R manually in the Java class – Ajil O. Nov 30 '17 at 12:43
  • 1
    Most probably, this is due to the error in XML files. Please recheck your XML file which you had recently updated and try to sync the Gradle files. – jazzbpn Nov 30 '17 at 12:53
  • I'm getting the same after an update. Ok, i had to remove roundicon and all references to backup in my manifest Something oreo introduced I guess – linuxgnuru Dec 01 '17 at 10:32
  • Check your XML files. Example solution: https://stackoverflow.com/a/28975079/7705712 – Edward D. Wilson Oct 24 '18 at 08:26

3 Answers3

1

Happened to me too 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

Musili Alfred M.
  • 3,085
  • 1
  • 15
  • 12
0

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...

Raja
  • 2,775
  • 2
  • 19
  • 31
-1

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

grandia
  • 709
  • 7
  • 20