Android:无法解析类型 java.lang.Enum
我下载了 Android 的浏览器项目(从 git)并将其导入到 Eclipse 中。但是由于以下错误,我无法构建它:
java.lang.Enum 类型不能是 解决了。是间接引用的 来自所需的 .class 文件
现在...这是一个对于其他项目运行良好的开发环境:
- Windows 7 Ultimate 64 位。
- JDK 64 位(已安装 jdk-6u23-windows-x64.exe。)
- Eclipse Classic 3.6 64 位(eclipse-SDK-3.6.1-win32-x86_64.zip)
- Android 2.3 SDK Starter Package
所以我不确定在哪里问题可能在于。
我该如何解决这个问题?
I downloaded Android's Browser project (from git) and imported it to Eclipse. I cannot build it however because of the following error:
The type java.lang.Enum cannot be
resolved. It is indirectly referenced
from required .class files
Now... this is a development environment that has been working very well for other projects:
- Windows 7 Ultimate 64-bit.
- JDK 64-bit (jdk-6u23-windows-x64.exe installed.)
- Eclipse Classic 3.6 64-bit (eclipse-SDK-3.6.1-win32-x86_64.zip)
- Android 2.3 SDK Starter Package
So I am not sure where the problem could lie.
How do I solve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
充其量,您的构建路径是混乱的。右键单击项目名称,然后选择“构建路径”>“构建路径”。配置
从上下文菜单中构建路径。这将在“订单和导出”选项卡上显示项目属性窗口的构建路径部分。如果未选中 Android JAR,请选中它,然后关闭属性窗口。
在最坏的情况下,您尝试纯粹从 SDK 构建此项目,这不太可能起作用,因为很少有 AOSP 应用程序被设计为在完整固件构建之外构建。
At best, your build path is messed up. Right-click over the project name, and choose Build Path > Configure
Build Path from the context menu. This brings up the build path portion of the project properties window, on the "Order and Export" tab. If the Android JAR is not checked, check it, then close the properties window.
At worst, you are trying to build this project purely from the SDK, which is unlikely to work, because few of the AOSP apps are designed to be built outside of the full firmware build.
这不是android的问题,而是eclipse的问题。
检查:
It's not an android issue, it's an eclipse issue.
Check:
我从 JDK 1.6.0_24 升级到 1.6.0_32,问题就消失了:)
I upgrade from JDK 1.6.0_24 to 1.6.0_32 and the problem is gone :)