I recently updated to Android Studio 3.0 and noticed that when I for example add any android:id, or create new drawable, or basically any resource, Android Studio does not update it in project until I build application. Every resource I create in xml, in class is marked as red and standard "Cannot resolve symbol ..." is shown. But surprisingly if you try to go to declaration, it correctly goes to the resource. Is there any option for this not to happen? It's very irritating.
Edit:
It's still occuring sometimes, but I just got used to it. If someone fixed it I will be thankful for your answer.
I resolved this problem in this way:
Navigate to Android Studio Settings - Build,Execution,Deployment - Gradle
Choose "Use local gradle distribution" and "Offline work", click "Apply"
At last you'll find it's ok, and at this time you can also choose back to "use default gradle wrapper", it's normal
来源:https://stackoverflow.com/questions/46976861/resources-ids-not-updating-in-android-studio-3-0