Eclipse的错误,R不能解析到一个变量变量、错误、Eclipse

2023-09-11 11:19:26 作者:不羁岁月

我得到在Eclipse IDE中的经典错误。我无聊的Eclipse的错误。他们快把我逼疯了。

I am getting this classic error in Eclipse IDE. I am bored of Eclipse's bugs. They driving me mad.

我几乎尝试了所有这些建议作为溶液(谷歌搜索)。他们没有工作。

I almost tried everything which suggested as solution (by Googling). None of them worked.

我的项目是工作正常,但不是code的变化。

My project was working normally but not code changes.

我看到我的code变化不作用于我的应用程序(的AVD)然后我打扫我的项目(​​在项目>清洁... ) 。 R.java 文件消失了,res文件夹是空的。

I see that my code changes does not acting on my app (on AVD) then I cleaned my project (under Project > Clean...). R.java file was gone and res folder was empty.

现在我得到这个错误:研究不能被解析为一个变量

Now I am getting that error: R cannot be resolved to a variable.

我应该怎么办?

和我也试图从现有的code删除的项目,并与再次创建Android项目我已经备份了。清洗后,它已经提供了同样的错误。

And also I tried to delete project and create again with Android Project from Existing Code I've backed-up before. It already gives same error after cleaning.

任何想法,将AP preciated。

Any ideas would be appreciated.

推荐答案

我假定你已经更新ADT版本22,而不是如何产生R.java文件。

I assume you have updated ADT with version 22 and R.java file is not getting generated.

如果是这种情况,然后在这里是解决方案:

If this is the case, then here is the solution:

希望你知道Android的工作室拥有摇篮建设的工具。同在eclipse他们在Tools文件夹名为Android的SDK内建的工具,需要安装赋予了新的组件。打开Android SDK中管理器,选择新添加的构建工具,安装,更新后重新启动SDK管理器。

Hope you know Android studio has gradle building tool. Same as in eclipse they have given new component in the Tools folder called Android SDK Build-tools that needs to be installed. Open the Android SDK Manager, select the newly added build tools, install it, restart the SDK Manager after the update.