问题描述
我最近更新到了Android Studio 3.0,并注意到例如当我添加任何android:id或创建新的drawable或基本上任何资源时,Android Studio不会在项目中对其进行更新,直到我构建应用程序.我在xml中,类中创建的每个资源都标记为红色,并显示标准的无法解析符号...".但是令人惊讶的是,如果您尝试去声明,它会正确地去往资源.有什么选择可以避免这种情况发生的吗?这很烦人.
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.
有时候它还在发生,但是我已经习惯了.如果有人修复了该问题,我将感谢您的答复.
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:
导航到Android Studio设置-构建,执行,部署-Gradle
Navigate to Android Studio Settings - Build,Execution,Deployment - Gradle
选择使用本地gradle分发"和脱机工作",然后单击应用"
Choose "Use local gradle distribution" and "Offline work", click "Apply"
最后您会发现还可以,这时您还可以选择返回使用默认的gradle包装器",这很正常
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
这篇关于资源ID在Android Studio 3.0中未更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!