본문 바로가기

Android/Knowhow

안드로이드 스튜디오 cannot resolve symbol r :: 강력한 해결법

File > Invalidate Caches / Restart > Invalidae and Restart



Clean이랑 Rebuild 해봐도 에러 해결이 안된다.

하지만 Invalidate Caches 한 방이면 해결이 된다.



If you see this error after moving java files or directories to other locations, then you can guarantee that Android Studio has gotten confused. And guess what? undo-ing those actions doesn't fix the problem.

So you try a clean, but that doesn't work.

And restarting doesn't work either.

But try File -> Invalidate Caches / Restart... -> Invalidate and Restart.

Android Studio maintains information about which files are dependent on which other files. And since moving files around is not implemented correctly, moving files causes errors. And that's not all: caches of these dependencies are used in an attempt to speed up the build.

This means you not only have to restart, but you need to invalidate those caches to restore (or more accurately, rebuild) sanity.



출처

http://stackoverflow.com/questions/17054000/cannot-resolve-symbol-r-in-android-studio/32119880#32119880

'Android > Knowhow' 카테고리의 다른 글

배열 객체는 가급적 쓰지말자  (0) 2016.12.23
[Android] input String quotes in BuildConfig  (0) 2016.09.09
[JAVA] input char array to special chars  (0) 2015.11.11
[color] Hex Opacity Values  (0) 2015.09.25
Adapter  (0) 2015.07.13