该项目未构建,因为其构建路径不完整

发布于 2025-01-06 16:18:50 字数 383 浏览 1 评论 0原文

每次我尝试将从 googlecode 下载的项目导入到 Eclipse 中时,都会遇到一些错误:

该项目未构建,因为其构建路径不完整。不能 找到 java.lang.Object 的类文件。修复构建路径然后尝试 构建这个项目

无法解析目标“android-10”(从 1 更改为 15)

我已经检查了网站上的其他答案,但没有解决方案有效。

属性-> Java 构建路径 ->图书馆

有 1 项:

无法获取项目的系统库

Every time I try to import a project downloaded from googlecode into Eclipse but I get some errors:

The project was not built since its build path is incomplete. Cannot
find the class file for java.lang.Object. Fix the build path then try
building this project

Unable to resolve target 'android-10' (this changes from 1 to 15)

I've already checked the other answers on the site but no solution worked.

In

Properties -> Java Build Path -> Libraries

there's 1 item:

Unable to get system libraries for the project

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(18

友欢 2025-01-13 16:18:51

转到 eclipse → 首选项 → Java → 构建路径。

您是否看到那里配置了 JRE_LIB ?如果没有,请从 JDK/jre lib 位置添加 JRE_LIB。这些可以在每个项目中被覆盖。看来你的 eclipse 不知道 Java 库。

Goto eclipse → Preferences → Java → Build path.

Do you see a JRE_LIB configured there? If not, add JRE_LIB from JDK/jre lib location. These can be overridden per project. It seems your eclipse isn't aware of Java libraries.

妥活 2025-01-13 16:18:51

我过去在 Eclipse 中导入项目时见过这样的错误。解决方案是转到属性 -> Android 并适当选择项目构建目标(Android xxx 或 Google API)

I have seen such errors in past while importing projects in eclipse. The solution to that is to go to properties->Android and select project build target appropriately (Android x.x.x or Google APIs)

等风来 2025-01-13 16:18:51

今天在尝试加载 Vuforia 示例应用程序时遇到了这个问题,时间太长了。最终构建我的项目的解决方案是:

1) Window->Android SDK Manager 并安装最新更新
2) Project->Build Path->Configure Build Path->Android 并在 Project Build Target 下标记 Android 4.4.2 并单击 OK
3) 清理、构建和运行

我希望这也能解决其他人的问题,Eclipse 令人沮丧,F$#@!!!

Was struggling with this while trying to load the Vuforia Sample App for way too long today. The solution that finally got my project to build was:

1) Window->Android SDK Manager and Install the latest updates
2) Project->Build Path->Configure Build Path->Android and under Project Build Target mark Android 4.4.2 and click OK
3) Clean, Build and Run

I hope this solves somebody else's issue as well, Eclipse is frustrating as F$#@!!!

沉溺在你眼里的海 2025-01-13 16:18:51

我遇到了类似的问题......
确保

  1. 您在工作区中创建项目。如果您的项目不在默认工作区中(其中存在 .metadata 文件夹(其中包含其他插件文件夹等)),那么它会要求您将构建路径配置为由于构建路径不完整,该项目未构建。

如果第一步很清楚,那么就这样做吧......

  1. 右键单击您的项目 ->构建路径->配置构建路径->图书馆 ->添加库-> JRE系统库->应用并关闭。

I encountered with the similar problem.....
Make sure that

  1. You create your project within your workspace. If your project is not in the default workspace where .metadata folder within which other plugin folders, and etc. will be present, then it will ask you to configure build path as the project is not build because of incomplete build path.

If the first step is clear, then go for this.....

  1. Right click on your project -> build path -> configure build path -> libraries -> Add libraries -> JRE system libraries -> Apply and close.
金橙橙 2025-01-13 16:18:51

我也遇到过类似的问题。完全相同的错误,但在我从 Windows 的 dropbox 文件夹中处理项目后,在 Ubuntu 中出现了错误。
我刚刚将 android.jar 添加到项目中。不知何故它从构建路径中消失了。

I've had similar problem. Exact same error, but in Ubuntu after I worked on project in dropbox folder from Windows.
I've just added android.jar to project. Somehow it disappeared from build path.

通知家属抬走 2025-01-13 16:18:51

对我来说,这个问题与 Ubuntu 上的 OpenJDK 6 有关。

更新您的 JRE 或安装 Sun 专有的 JRE,然后重新启动 Eclipse。

For me this problem was related to OpenJDK 6 on Ubuntu.

Update your JRE or install Sun's proprietary JRE instead and restart Eclipse.

一人独醉 2025-01-13 16:18:51

我知道这已经太晚了。但我也面临这个问题,我通过以下步骤解决了这个问题。

  1. 仅当项目在不同计算机之间共享时才会出现此问题。
  2. 对我来说,我发现 java JDK 是问题所在。
  3. 我的同事使用的是mac系统,使用的是jdk 1.7。但在我的系统中我使用的是jdk 1.6。
  4. 我想这可能就是问题所在。所以我选择项目并打开属性并将我的 jdk 更改为 1.7
  5. Change target=Google Inc.:Google APIs:19
  6. Clean & 最终构建

问题已修复。我认为这是因为如果您使用更高的 JDK 版本构建项目,那么您应该使用相同的版本构建。

注意:直到我的同事使用 JDK 1.7 构建之前,我们才遇到这个问题。在他开始使用 JDK 1.7 后,才出现这个问题。

希望它对某人有用。并且无需安装新的 eclipse。

I know this is too late. but I am also facing this issue and I fix this by following below steps.

  1. This issue is occurred only if the project shared between different machines.
  2. For me I found java JDK is the problem.
  3. My colleague used mac system and using jdk 1.7. but in my system I used jdk 1.6.
  4. I guess that may be the issue. So I select project and open properties and change my jdk to 1.7
  5. Change target=Google Inc.:Google APIs:19
  6. Clean & Build

Finally issue is fixed. I think this is because of If you build your project with higher JDK version thereafter you should build with same version.

NOTE : we are not facing this issue before until my colleague build with JDK 1.7. After he started to using JDK 1.7 only this issue occur.

Hope it will work for some one. And no need for install new eclipse.

十六岁半 2025-01-13 16:18:51

我在“项目”中关闭了“自动构建”。我将其关闭,因为由于各种未知原因,Eclipse 没有正确加载项目。打开这个,解决了我的问题。

I had my "Build Automatically" turned off in "Project". I turned it off, because the Eclipse was not loading the projects correctly, for various unknown reasons. Turning this on, solved my problem.

超可爱的懒熊 2025-01-13 16:18:51

如果项目不是很大,您可以复制包并将其粘贴到新项目中,您不会在新项目中看到错误。

if the project is not very big, you can copy the packages and paste it into a new project, you won't see the errors in the new project.

软的没边 2025-01-13 16:18:51

我的project.properties 中有target-18。但我没有 android-18 sdk。所以我将 18 更改为 SDK 管理器中的其他版本,它解决了问题。

I was having target-18 in my project.properties. But I wasn't having android-18 sdk. So I changed 18 to some other version which I had in my SDK manager, and it fixed the issue.

弃爱 2025-01-13 16:18:51

您只需退出 eclipse 一次或两次即可重新加载。这对我有用。

You just exit eclipse once or twice to reload. It works for me.

永言不败 2025-01-13 16:18:51

史蒂夫的答案确实对某些项目有帮助,但对于某些项目来说,它仍然保持不变。我猜这些项目之前是内置于早期 JDK 1.5 中的(就我而言)。但我找到了解决方法:

  1. 找到导致问题的类(继续在包资源管理器中扩展项目)。
  2. import 块之后复制类的内容。
  3. 删除整个班级。
  4. 右键单击该项目,然后Android Tools>>修复项目属性
  5. 在与之前删除的类相同的包下创建一个同名的类。 (如果项目已导入并且删除的类是 Activity/Service/Provider/Reciever,我猜该类已包含在 AndroidManifest.xml 中)。
  6. 粘贴类的内容并导入包。
  7. 清理项目。

Steve's answer does help for some projects, but still, for some projects, it remains the same. I guess that projects were previously build-in early JDK 1.5 (in my case). But I found a workaround for them:

  1. Find the class that causes the problem (Keep expanding the project in the Package Explorer).
  2. Copy the class's contents after the import block.
  3. Delete the whole class.
  4. Right Click on the project then Android Tools >> Fix Project Properties
  5. Create a class with the same name under the same package the deleted class was before. (If the project is imported and the deleted class was an Activity/Service/Provider/Reciever, I guess the class is already included in the AndroidManifest.xml).
  6. Paste the content of the class and import packages.
  7. Clean the project.
狼亦尘 2025-01-13 16:18:51

我必须删除 gen 文件夹中的 R.java,然后进行干净的构建。这解决了我的问题。

I had to delete R.java in the gen folder, then do a clean build. This solved my issue.

两相知 2025-01-13 16:18:50

右键单击项目->属性-> Java 构建路径(从左侧列表开始)->库(选项卡)->添加库(右侧按钮)-> JRE系统库->下一步->工作区默认 JRE ->完成

这应该至少可以解决您的一个错误。任何其他可能需要您添加更多库。

Right click on project -> Properties -> Java Build Path (From Left List) -> Libraries (Tab) -> Add Library (Button on right) -> JRE System Library -> Next -> Workspace default JRE -> Finish

This should solve at least one of your errors. Any others might require you to add further libraries.

甜嗑 2025-01-13 16:18:50

关闭 eclipse 并重新打开对我有用。您可能需要执行此操作两到三次。每次给它一分钟的时间来完成自动构建启动过程(检查右下角),因为这些错误通常会在此时消失。

或者尝试清理受影响的项目。

“将其关闭并再次打开”

Close eclipse and re-open worked for me. You may have to do this two or three times. Each time give it a minute for the auto build startup process (check bottom right hand corner) to complete, as these errors often disappear at this time.

Or try to clean the affected projects.

'Turn it off and on again'

撩人痒 2025-01-13 16:18:50

看来你缺少JDK(java.lang.Object来自那里)

问题是你在不同的PC上使用了相同的Android API。 Eclipse 会因为路径名不同但 API 相同而丢失。

要解决这个问题,首先重新选择 Android API 版本(设置为另一个版本并有效,然后恢复您想要的版本并验证它 -> 这将强制 Eclipse 重新加载 API)。
然后进入项目->属性-> java 构建路径。然后删除“无法获取项目的系统库”,然后删除“添加库”并选择“Android Classpath 容器”。

It seems that you lack JDK (java.lang.Object comes from there )

The problem is that you used the same Android API on different PC. Eclipse is lost with path names that are differents but with same API.

To solve it, first re-select Android API version (set to another one and valid, then restore the on you want and validate it -> it will force Eclipse to reload API).
Then go into project->properties-> java build path. Then remove "Unable to get system library for the project" then "Add library" and select "Android Classpath container".

静谧 2025-01-13 16:18:50

最初我试图从github导入一个android项目,遇到了上述问题

  • 无法配置构建路径

  • 无法获取系统库


包资源管理器 ->右键单击项目-> “属性”->
“安卓”-> “项目构建目标”= 2.3.3

注意:还可以尝试“清理”(在 Windows 上:“项目”->“清理”),然后随机刷新 (F5)。这很有可能神奇地解决您所有的问题。


礼貌:凯尔·克莱格
参考链接

Initially I was trying to import an android project from github and encountered the above problem

  • cannot configure build path

  • unable to get system libraries


Package Explorer -> Right click the project -> “Properties” ->
"Android" -> "Project Build Target" = 2.3.3

Note: Also try Clean (On Windows: Project -> Clean) then Refresh (F5) at random. There's a good chance this will magically solve all your problems.


courtesy: KYLE CLEGG
reference link

若能看破又如何 2025-01-13 16:18:50

这些都不适合我。我为项目创建了一个新的工作区。这对我有用!切换到新的工作空间通常会奇迹般地解决许多此类配置问题。只需在您想要放置新工作区的位置创建一个新文件夹,然后使用“从现有代码导入项目”即可。

None of this worked for me. I created a new workspace for the projects. That worked for me! Switching to a new workspace usually miraculously solves a lot of these configuration problems. Simply create a new folder where you would want your new workspace to be and then use 'import project from existing code'.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文