更新到 ADT 14 后无法构建依赖库的项目

发布于 2024-12-10 19:56:28 字数 188 浏览 0 评论 0原文

为了实现不同版本的 UI,我们将程序分解为特定于 UI 的代码和一个包含其他所有内容的通用库项目。直到昨天我更新到 ADT 14 时一切都工作正常。现在我无法构建。我不断收到错误“容器‘库项目’引用了不存在的库‘我的公共项目的 bin 文件夹的路径和项目.jar 的名称’

我已经在网络上到处寻找并尝试了我能想到的一切有人可以帮我解决这个问题吗?

In order to implement different versions of our UI we broke our program up into UI specific code and a common library project that has everything else. Up until yesterday when I updated to ADT 14 everything was working fine. Now I can't build. I keep getting the error "The container 'Library Projects' references non existing library 'path to the bin folder of my common project and the name of the project.jar'

I've been all over the web and tried everything I can think of to fix this to no avail. Can someone help me out? I'm basically stuck at this point.

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

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

发布评论

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

评论(4

染年凉城似染瑾 2024-12-17 19:56:28

也许您在切换到新的 ADT 时遇到了与我相同的问题:

在我之前的设置中,我在库和主项目之间分配了一些资源。库项目本身不会无错误编译,只能与添加了缺失资源的主项目结合使用。

它不再像这样工作了。

库项目现在必须完全无错误地编译。当它执行时,构建过程将在库项目的 bin 文件夹中创建一个.jar。

如果未创建 jar 文件(因此库项目的构建过程由于某种原因失败 - 例如,因为 R.java 文件中的更改(请参阅 http://tools.android.com/recent/buildchangesinrevision14 )) 您将收到您所描述的错误消息。

另外,我必须手动从项目中删除_src 。

Maybe you have the same issues I had when switching to the new ADT:

In my previous setup I had some resources split between the library and the main project. The library project would not compile error free on its own but only in combination with the main project which added the missing resources.

It doesn't work like this any more.

The library project must compile completely error free now. When it does the build process will create a <lib_project_name>.jar in the bin folder of the library project.

If the jar file is not created ( thus the build process of the library project failed for some reason - eg. because the changes in the R.java file (see http://tools.android.com/recent/buildchangesinrevision14 )) you will get the error message you described.

Also, I had to manually remove the <lib_project>_src from the project.

大海や 2024-12-17 19:56:28

我在几个不同的项目中遇到了问题,我在其中执行了其他答案中建议的修复,但它们只是暂时修复。

每次我重新打开 Eclipse 或对项目执行 Clean 操作时,“Library Projects”目录就会消失,我必须打开项目属性,删除库,然后再次添加它。

我通过创建一个新项目并将所有内容复制到其中来解决这个问题。

然后我找到了一个简单的方法来解决它。右键单击项目,Refactor-->Rename。您可以稍后将其重命名回来。这解决了它。

I've had a problem with a few different projects where I did the fixes suggested in the other answer, but they were only fixed temporarily.

Every time I reopened Eclipse or did a Clean on a project, the "Library Projects" directory would disappear, and I would have to open the project properties, remove the library, and add it again.

I solved this the hard way by creating a new project and copying everything into it.

Then I found an easy way to solve it. Right click the project, Refactor-->Rename. You can rename it back afterwards. This fixed it.

吻安 2024-12-17 19:56:28

查看文章“Android SDK 工具中的库项目的更改,r14”(http://android-developers.blogspot.com/2011/10/changes-to-library-projects-in-android.html ) Android 开发者博客。

例如@P.Melch:“我必须手动从项目中删除 _src”应该按如下方式完成:

要修复该项目,您必须按照以下步骤删除无关的源文件夹:

  • 右键单击源文件夹并选择“构建路径”>从构建中删除
    路径。
  • 将会弹出一个对话框。在其中,确保选中“同时取消该文件夹与项目的链接”以完全删除该文件夹。

Check out the article "Changes to Library Projects in Android SDK Tools, r14" ( http://android-developers.blogspot.com/2011/10/changes-to-library-projects-in-android.html ) on the Android Developers blog.

E.g. @P.Melch: "I had to manually remove the _src from the project" should be done as follows:

To fix the project, you must remove the extraneous source folders with the following steps:

  • Right click source folder and choose Build Path > Remove from Build
    path.
  • A dialog will pop up. In it, make sure to check “Also unlink the folder from the project” to completely remove the folder.
望她远 2024-12-17 19:56:28

您必须在 Android SDK Manager

Android SDK Tools Installed 中更新 Android SDK
安装的Android SDK平台
已安装 Android SDK 版本

You have to update the Android SDK in Android SDK Manager

Android SDK Tools Intalled
Android SDK Plataforms Installed
Android SDK Builds Installed

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