Resources ids not updating in Android Studio 3.0

安稳与你 提交于 2019-12-07 11:14:39

问题


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.


回答1:


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!