"不能解析符号R"在机器人工作室 [英] "cannot resolve symbol R" in Android Studio

查看:143
本文介绍了"不能解析符号R"在机器人工作室的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的所有类的每一个实例,其中我引用R.id.something的R是红色,它说不能解析符号R,也有R.layout.something它有红色下划线,每一次说无法解析法的setContentView(?)。该项目却从来没有建立并执行工作的罚款。这只是讨厌看到这一切的时候。我看了很多其他的问题就在这里大约从日食类似的东西,但大多数参与导入项目。我使用了我认为是最新版本的Andr​​oid工作室和项目与Android Studio中创建和工作没有任何无法解决ř问题。我想知道是什么原因导致这如果有人知道。

In every instance in all of my classes where i reference R.id.something the R is in red and it says "cannot resolve symbol R", also every time there is R.layout.something it is underlined in red and says "cannot resolve method setContentView(?)". The project however never fails to build and does work fine. It is just annoying to see this all the time. I have read many other questions on here about something similar but most involved importing projects from eclipse. I am using what i believe to be the most recent version of android studio and the project was created with android studio and worked without any cannot resolve R problems. I would like to know what causes this if anyone knows.

更新: 请接受我的道歉从来没有更新此。我解决我自己的问题,因为这已经形成。当时Android的工作室是全新的,我也是一个全新的开发。我永远不会使用Android的工作室已经,我从来没有意识到它是如何未完成了。感谢大家的努力帮助,因为这已经公布的支持。讽刺的是实际的答案这个问题已被删除,无法撤消删除。我觉得我原来的答复是解决这个问题,总之不要使用Android的工作室,如果你是新的Andr​​oid开发。

UPDATE: Please accept my apologies for never updating this. I solved my own problem since this has been posted. At the time android studio was brand new and I was also a brand new developer. I should never had been using android studio, I never realized how unfinished it was. Thanks everyone for the support in trying to help since this has been posted. Ironically the actual "answer" to this question has been deleted and cannot be undeleted. I feel that my original answer is the solution to this problem, in short don't use android studio if you are new to android development.

推荐答案

我有这个这个问题了。一个简单的'gradlew干净'和'gradlew构建并获得成功。

I had this this issue too. A simple 'gradlew clean' and 'gradlew build' did the trick.

点击建设 - >清理项目,然后将执行一个干净的摇篮

Click on Build->Clean Project and that will perform a gradle clean

这篇关于"不能解析符号R"在机器人工作室的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆