简体   繁体   English

来自库项目的Jar未在Android应用中解析

[英]Jar from library project not resolved in Android app

I'm building an Android app which uses a library that is defined in another Eclipse project (same workspace). 我正在构建一个Android应用程序,它使用在另一个Eclipse项目(相同的工作区)中定义的库。 All is working fine, but now I added a jar file to the library project's build path. 一切正常,但现在我将一个jar文件添加到库项目的构建路径中。 In Eclipse I exported the jar file to make it visible to dependent projects of the library (Build Path -> Order and Export -> mark the jar file). 在Eclipse中,我导出了jar文件,使其对库的依赖项目可见(Build Path - > Order and Export - >标记jar文件)。 Still Eclipse (ADT) complains that the import cannot be resolved. 仍然Eclipse(ADT)抱怨导入无法解决。 I have set up a test project for the library as well, and there the imports are visible after exporting the jar file as mentioned above. 我也为库设置了一个测试项目,如上所述,在导出jar文件后可以看到导入。 Is there anything I forgot to configure? 有什么我忘记配置的吗?

Regards, Martin 此致,马丁

ADT doesn't seem to pick it up automatically :-/ ADT似乎没有自动提取: - /

Manually configuring the main project's build path to rely on the library project's jars worked for me. 手动配置主项目的构建路径以依赖库项目的jar为我工作。

Build Path -> Libraries -> Add JARs -> {Library Project}\\libs\\myjar.jar 构建路径 - >库 - >添加JAR - > {Library Project} \\ libs \\ myjar.jar

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM