4

I have just updated my android studio and now all my resources are errors!

  • I have debugged and debugged but no avail.
  • All my xmls files are okay,
  • all strings start with lower case.
  • I have also restarted the program
ngrashia
  • 9,869
  • 5
  • 43
  • 58
user2512394
  • 73
  • 2
  • 5

8 Answers8

6

This is a known bug in the newest version of android studio 0.1.6. Google has suggested a temporary workaround until they can track down the problem and fix in next release. turn off external builds in preferences > compiler.

Adam Johns
  • 35,397
  • 25
  • 123
  • 176
2

You seem to have updated the Android SDK Tools to version 22, but you might not have updated the Android SDK Build-Tools to the latest version. Update it from the sdk manager and restart. See this answer on similar question: Eclipse giving error, missing R.java file after recent update . Hope this helps

Community
  • 1
  • 1
Shobhit Puri
  • 25,769
  • 11
  • 95
  • 124
1

have you tried the build button in android studio? .... use it and click rebuild project, see what happens.

Asiimwe
  • 2,199
  • 5
  • 24
  • 36
  • 1
    rebuilding the project will work, but you have to rebuild the project every time you make a change with this current bug. see my answer for google's suggested workaround. – Adam Johns Jun 22 '13 at 22:42
  • I updated my studio today, i don't seem to see this bug but alright – Asiimwe Jun 22 '13 at 22:45
  • many people are. maybe it is not affecting everyone: https://code.google.com/p/android/issues/detail?id=56843&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars – Adam Johns Jun 22 '13 at 22:48
  • Been on the forums on your link and rebuild has surprisingly helped many people, including me. thanks anyways – user2512394 Jun 22 '13 at 22:51
1

"Settings"/"Preferences" -> "Compiler" Check "Use external build" if you are using gradle and uncheck "Use external build" if you are NOT using gradle.

Sources: https://code.google.com/p/android/issues/detail?id=56843 https://code.google.com/p/android/issues/detail?id=56531

jalbasri
  • 328
  • 2
  • 13
1

That error went away for me when I simply Built the project (Ctrl+F9).

user2788925
  • 73
  • 1
  • 4
0

I have the same problem, all you have to do is press, "Build > Rebuild Project" before each Run or debug. I hope this error is fixed asap.

string.Empty
  • 10,393
  • 4
  • 39
  • 67
0

Updated "Tools -> Android -> SDK Manager" updated tools and SDK to latest version.

Also updated android:targetSdkVersion="18" to latest in AndroidManifest.xml and it resolved the issue.

Prakash
  • 4,479
  • 30
  • 42
0

In Android Studio can not resolve R error is occured due to build.gradle file the minmum sdk and minSdkVersion and targetSdkVersion sdk platform should be installed and if updates avilable update it first. Another thing buildToolsVersion and android.support:appcompat should be clear so no ambiguity found. You can set these manually from build.gradle or from File -> Project Structure -> app and Flavors. enter image description here Some other causes of R can not be resolve can be due to error in .xml file. Most time I solve my issue with these methods.

NomanJaved
  • 1,324
  • 17
  • 32