eclipse SDK/ADT-Update 后 Android 库依赖项被破坏

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16669978/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 20:33:17  来源:igfitidea点击:

Android Library Dependencies broken after SDK/ADT-Update

androideclipsedependenciesandroid-librarybuildpath

提问by Chris

Today, I updated my Android SDK and Eciple ADT to the most recent versions (ADT Rev 22). After restarting Eclipse it is quite unhappy with the Build Paths whenever I reference custom libraries.

今天,我将我的 Android SDK 和 Eciple ADT 更新到了最新版本(ADT Rev 22)。重新启动 Eclipse 后,每当我引用自定义库时,它对构建路径非常不满意。

An example is shown in this screenshot: enter image description here

此屏幕截图中显示了一个示例: 在此处输入图片说明

My custom "Android Utilities Library" compiles fine, but everything that depends on it shows build path errors. E.g. when I investigate the build path settings for "Android URA Library" it shows me an error with the android_utilities_library.jarmissing under "Android Dependencies" (which in fact is true, the libraries will be built to individual class files in bin/classes).

我的自定义“Android 实用程序库”编译良好,但依赖于它的所有内容都显示构建路径错误。例如,当我调查“Android URA 库”的构建路径设置时,它向我显示了android_utilities_library.jar“Android 依赖项”下缺失的错误(事实上​​,库将构建到bin/classes.

After reading the solution to Build path errors with library projectsI tried to clean and manually build my projects in the correct order, but to no avail.

在阅读了使用库项目构建路径错误的解决方案后,我尝试以正确的顺序清理并手动构建我的项目,但无济于事。

I've never dealt with this before, so I don't know how to attack the problem.

我以前从未处理过这个问题,所以我不知道如何解决这个问题。

Any help is appreciated. Thx!

任何帮助表示赞赏。谢谢!

采纳答案by Chris

Installing the new Build Tools did the trick. They were not automatically included when I updated the SDK (probably need to run the update twice I guess).

安装新的构建工具可以解决问题。当我更新 SDK 时,它们不会自动包含在内(我猜可能需要运行更新两次)。

回答by Kyso84

I found a solution that works for me: Go to Project Properties > Build Path > Order and Export

我找到了一个适合我的解决方案:转到项目属性 > 构建路径 > 订购和导出

Then you have to check each checkbox. In my case my libraries were restored

然后你必须检查每个复选框。就我而言,我的图书馆已恢复

I hope it will help.

我希望它会有所帮助。

回答by nnhthuan

I can see that your project Android URA Libraryis referring to Android Utilities Library, then the problem should not relate to SDK/ADT update.

我可以看到您的项目Android URA Library指的是Android Utilities Library,那么问题应该与 SDK/ADT 更新无关。

Please check:

请检查:

  1. Project Properties of Android URA Library, choose Project tab and make sure you added Android Utilities Libraryas dependency project. Otherwise, please add it.
  2. If the problem is still existing, then Projects \ Clean All Projects
  1. 的项目属性Android URA Library,选择项目选项卡并确保您添加Android Utilities Library为依赖项目。否则,请添加它。
  2. 如果问题仍然存在,则 Projects \ Clean All Projects

回答by Anand.B

Go to libraries and check the build path of the dependent libraries. It should be same as your projects build path.

转到库并检查依赖库的构建路径。它应该与您的项目构建路径相同。

回答by Hyman Li

if you have import all the Dependencies in your workSpace.maybe you can:projetc-->build all. I meet the problem,and it works well

如果您在工作区中导入了所有依赖项。也许您可以:projetc-->build all。我遇到了这个问题,而且效果很好