Android: The type java.lang.Enum cannot be resolved

牧云@^-^@ 提交于 2019-12-17 20:27:32

问题


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:

  1. Windows 7 Ultimate 64-bit.
  2. JDK 64-bit (jdk-6u23-windows-x64.exe installed.)
  3. Eclipse Classic 3.6 64-bit (eclipse-SDK-3.6.1-win32-x86_64.zip)
  4. Android 2.3 SDK Starter Package

So I am not sure where the problem could lie.

How do I solve this?


回答1:


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.




回答2:


It's not an android issue, it's an eclipse issue.

Check:

  • Can not compile enums in Eclipse.
  • Eclipse's email list.



回答3:


I upgrade from JDK 1.6.0_24 to 1.6.0_32 and the problem is gone :)



来源:https://stackoverflow.com/questions/5293110/android-the-type-java-lang-enum-cannot-be-resolved

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!