eclipse 未生成 R.java 文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11869307/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
R.java file not getting generated
提问by Nimit_ZZ
I'm unable to the R.java problem in my half built Facebook app. I have selected the "Build automatically" option, I cleaned my project. I did all the recommended solutions to generate my R.java file.But still no success. I have 2 R.java in my "gen" folder. I have put a screenshot for better understanding.
我无法解决我一半构建的 Facebook 应用程序中的 R.java 问题。我选择了“自动构建”选项,我清理了我的项目。我做了所有推荐的解决方案来生成我的 R.java 文件。但仍然没有成功。我的“gen”文件夹中有 2 个 R.java。我放了一张截图以便更好地理解。
all the buttons, textview and imageviews are not being recognized.
无法识别所有按钮、文本视图和图像视图。
采纳答案by durgeshtrivedi
Try this: I have similar problem R.java not found error it is actually not getting generated
试试这个:我有类似的问题 R.java not found 错误它实际上没有被生成
I did almost every thing which are said in the different links in the forum
我几乎做了论坛中不同链接中所说的所有事情
What I did
我做了什么
1.I delete the project from the workspace and re import it,after doing that when the project launched it start giving me the SDK not found error even I was given the correct Android SDK path.I am using eclispe ADT which you can find from android site itself.
1.我从工作区中删除项目并重新导入它,然后当项目启动时它开始给我找不到 SDK 错误,即使我得到了正确的 Android SDK 路径。我正在使用 eclispe ADT,你可以从安卓网站本身。
2.I don't know why ADT plugin was showing it needs to update even the latest ADT 21.1 is installed .I tried to updated that then ,i don't know how tools folder from my SDK get deleted after that .It start shouting tools folder not found in SDK folder .So I need to download the SDK again and update the ADT plugin to 21.1 .
2.我不知道为什么 ADT 插件显示它需要更新,即使安装了最新的 ADT 21.1。我尝试更新它,我不知道在那之后我的 SDK 中的工具文件夹如何被删除。它开始大喊大叫在 SDK 文件夹中找不到 tools 文件夹。所以我需要再次下载 SDK 并将 ADT 插件更新到 21.1。
3 So I think some time there is problem in ADT plugin ,So keep it update correctly or reinstall it will works if nothing else works .
3 所以我认为 ADT 插件有一段时间存在问题,所以保持它正确更新或重新安装它,如果没有其他效果,它会起作用。
回答by Nayeem
I too had similar issue...
我也有类似的问题...
I went through many link from Google, but no use. At last I open Android SDK Manager to see if any thing missing from installed packages, and found "Android SDK Built-tools" is not installed.
我浏览了许多来自谷歌的链接,但没有用。最后我打开 Android SDK Manager 查看已安装的软件包中是否缺少任何东西,发现没有安装“Android SDK Built-tools”。
I installed and follow below steps:
1. re-open eclipse.
2. comment error lines
3. build All
4. uncomment error lines to see if error gone.
我安装并按照以下步骤操作:
1. 重新打开 eclipse。
2. 注释错误行
3. 构建所有
4. 取消注释错误行以查看错误是否消失。
Hope this will help someone...
希望这会帮助某人...
回答by Korcholis
Try this:
尝试这个:
- Delete any import to an
R.java
class (like @zapl pointed out). - Move your cursor to a reference to any button/layout/string/whatever-coming-from-R, delete the last character, and hit
ctrl+space
. Eclipse will try to codehint you, automatically importing the correctR.java
. - Just to keep it cool, clean and rebuild.
- 删除对
R.java
类的任何导入(如@zapl 指出的那样)。 - 将光标移动到任何按钮/布局/字符串/任何来自 R 的引用,删除最后一个字符,然后点击
ctrl+space
。Eclipse 将尝试对您进行编码提示,自动导入正确的R.java
. - 只是为了保持凉爽、清洁和重建。
回答by Matan
It happend to me when I located a png file with a CAPITAL LETTER in its name. The whole name should contain non-capital letters ONLY!
当我找到一个名称中带有大写字母的 png 文件时,它发生在我身上。全名只能包含非大写字母!
回答by priki
I had this problem too. The solution I had was: installing the lib32z1 and lib32stdcc++6, which were missing
我也有这个问题。我的解决方案是:安装缺少的 lib32z1 和 lib32stdcc++6
sudo apt-get install lib32z1
须藤 apt-get 安装 lib32z1
sudo apt-get install lib32stdcc++6
须藤 apt-get 安装 lib32stdcc++6
回答by htafoya
I had to update to latest Android Studio Version (3.3.2 at the moment)
我必须更新到最新的 Android Studio 版本(目前为 3.3.2)