参考这里: http://blog.youkuaiyun.com/dong19870625/article/details/50833433
原文:
在开发项目中,xml文件突然出现
Couldn’t resolve resource @color/title_color (58 similar errors not shown)问题,让人措手不及,将颜色等资源文件直接写上就没有问题,但是不是根本解决问题的方法,后来在stack overflow上发现可以这样说:
Android Studio just gets crazy. But a restart ain’t always enough.
Invalidate your caches and restart.
File -> Invalidate Caches / Restart… -> Invalidate and Restart
按照上述做法,效果不错,解决了我的问题,原来AS本身也有缓存
参考:http://stackoverflow.com/questions/8390733/relativelayout-couldnt-resolve-resource-android
---------------------------------------------
我也是遇到差不多的,不过是找不到相关的style,在预览那里无法正常显示,但是运行起来是正常的.无论refresh还是rebuild都消除不了.按照上面的做法就ok了.