Android ADT 版本 22,未生成 R.java 文件

2023-08-22Java开发问题
4

本文介绍了Android ADT 版本 22,未生成 R.java 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

升级到 Android ADT 版本 22 并清理我的项目后,R.java 文件丢失了.我不能使用 setViewContent(R.layout.activity_main) 因为活动不能引用 xml 布局(由于缺少 R.java).另外,当使用 (ctrl + space) 获取 setContentView 的建议时,没有输入代码.查看错误日志后,显示存在未处理的事件循环异常".涉及的插件是org.eclipse.ui.

After upgrading to Android ADT version 22 and cleaning my project, the R.java files went missing. I can't use setViewContent(R.layout.activity_main) because the activity cannot reference to the xml layout (due to the missing R.java). Also, when using the (ctrl + space) to get suggestions for setContentView, the code is not typed in. Upon looking at the error log, it shows that there was an "Unhandled event loop exception". The plug-in involved is the org.eclipse.ui.

另外,每当我创建一个新的 Hello World 项目时,gen 文件夹都是空的.几个小时后,我尝试了android studio.但我不喜欢那里.然后,当我回到 Eclipse 时,SDK 平台工具和构建工具有了更新.我更新了它们,但仍然出现错误.

Also, whenever I create a new Hello World project, the gen folder is empty. After a few hours, I tried the android studio. But I didn't like it there. Then, when I went back to Eclipse, there was an update for SDK platform tools and build tools. I updated them but I still get the errors.

我尝试清理项目但没有运气.似乎是什么问题?

I tried cleaning the project but no luck. What seems to be the problem?

推荐答案

我也遇到了同样的问题,刚刚解决了.

I had the same problem just solved it.

检查:Java/Eclipse - 不再有 R 文件

更多信息:https://groups.google.com/forum/?fromgroups=#!topic/android-developers/rCaeT3qckoE%5B1-25-false%5D

这篇关于Android ADT 版本 22,未生成 R.java 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

在 Eclipse 项目中使用西里尔文 .properties 文件
Use cyrillic .properties file in eclipse project(在 Eclipse 项目中使用西里尔文 .properties 文件)...
2024-08-25 Java开发问题
18

如何在java中找出依赖于语言环境的文本方向?
How to find out locale-dependent text orientation in java?(如何在java中找出依赖于语言环境的文本方向?)...
2024-08-25 Java开发问题
24

Eclipse 在尝试启动 Android 应用程序时卡住了
Eclipse gets stuck when trying to launch Android app(Eclipse 在尝试启动 Android 应用程序时卡住了)...
2024-08-25 Java开发问题
14

Eclipse:无法初始化监视器线程:无法建立环回连接
Eclipse: Failed to initialize Monitor Thread: Unable to establish loopback connection(Eclipse:无法初始化监视器线程:无法建立环回连接)...
2024-08-25 Java开发问题
4

Eclipse-找不到JDK
Eclipse- JDK not found(Eclipse-找不到JDK)...
2024-08-25 Java开发问题
6

错误:CreateProcess 错误=216,此版本的 %1
Error:CreateProcess error=216, This version of %1(错误:CreateProcess 错误=216,此版本的 %1)...
2024-08-25 Java开发问题
9