简体   繁体   English

将ADT更新为22.0.1后,R.java缺失

[英]R.java missing after updating ADT to 22.0.1

I know this problem has been discussed in " Eclipse giving error, missing R.java file after recent update " and " R.java not generated after ADT update " but I still can't make it work. 我知道这个问题已经在“ Eclipse给出错误,最近更新后缺少R.java文件 ”和“ ADT更新后没有生成R.java ”中讨论过但我仍然无法使其工作。

My R.java file is not generated and I've searched here for answers but none of the answers have worked. 我的R.java文件没有生成,我在这里搜索了答案,但没有一个答案有效。 Everything worked just fine before I updated my ADT, so the code should be ok. 在我更新ADT之前一切正常,所以代码应该没问题。 This is what I've tried: 这就是我尝试过的:

  • I don't have any "import android.R". 我没有任何“import android.R”。
  • In "Project"-tab -> "Build Automatically" is checked. 在“项目”中 - 选项卡 - >“自动构建”已选中。
  • I've cleaned my project and restarted eclipse several times. 我已经清理了我的项目并重启了几次eclipse。
  • I've downloaded Android SDK Tools (22.0.1), Android SDK Platform-tools (Rev.17) and Android SKD Build-tools (Rev. 17). 我已经下载了Android SDK Tools(22.0.1),Android SDK Platform-tools(Rev.17)和Android SKD Build-tools(Rev。17)。
  • I've started a new "Android Sample Project" and a "Hello World" but the problem persists which means that there is no problem with my *.xml file. 我已经开始了一个新的“Android示例项目”和一个“Hello World”,但问题仍然存在,这意味着我的* .xml文件没有问题。
  • I've tried rightclicking on my project -> "Android Tools" -> "Fix Project properties". 我尝试右键单击我的项目 - >“Android工具” - >“修复项目属性”。
  • I've gone into "properties" of my project -> "Java Build Path" -> "Order and Export" where everything is checked and in this order: "src", "gen", "Android Private Libraries", "Android Dependencies", "Android 4.2.2", and two endpoint libraries (I'm working with App Engine). 我已经进入了我的项目的“属性” - >“Java Build Path” - >“Order and Export”,其中所有内容都按照以下顺序进行检查:“src”,“gen”,“Android Private Libraries”,“Android依赖关系“,”Android 4.2.2“和两个端点库(我正在使用App Engine)。
  • I've updated eclipse in "Help"-tab -> "Check for updates" and "no updates were is found" (I'm running Eclipse Juno SR2). 我在“帮助”中更新了eclipse - > - >“检查更新”和“没有找到更新”(我正在运行Eclipse Juno SR2)。
  • I've installed new software in "Help"-tab -> "Install new software" from " http://dl-ssl.google.com/android/eclipse/ " and " http://dl.google.com/eclipse/plugin/4.2 ". 我在“帮助” - “地图” - >“安装新软件”中安装了新软件,来自“ http://dl-ssl.google.com/android/eclipse/ ”和“ http://dl.google.com/ eclipse / plugin / 4.2 “。
  • In "project.properties" target=android-17 and in "manifest" android:targetSdkVersion="17". 在“project.properties”中,target = android-17,在“manifest”中,android:targetSdkVersion =“17”。

What should I do? 我该怎么办? Please help me out here ! 请帮帮我吧!

Check on Java Compliance level to be set at 1.6 检查Java合规性级别是否设置为1.6

Window -*Preferences*- Java Compiler Window - * Preferences * - Java编译器

Select on Compiler compliance level: 1.6 选择编译器合规级别:1.6

Also check on the problem window to see if your layouts (or other area) are showing an error and that is preventing the compiler to build the file. 还要检查问题窗口,看看您的布局(或其他区域)是否显示错误,并阻止编译器构建文件。

Check on Problem window Alt+Shift+Q,X 检查问题窗口Alt + Shift + Q,X

Post resolution as it might help others. 解决后,因为它可能会帮助其他人。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM