Jars added to an Android library are not getting referenced in the project

不打扰是莪最后的温柔 提交于 2019-12-30 09:54:12

问题


I have created an Android library where I included some external jars. These jars are seen in "Referenced Libraries" under the library project. When I reference this library in my other project, it is not able to link the jars that had been added to library. It shows errors to the referenced library under the project.

It should have linked the jars which are added in library, rather, it shows an error in the project in which I have added this library. Can anyone help me figure this out?


回答1:


If you've got your library project properly included, go to Properties -> Java Build Path -> Order and Export and check all the JARs you wish to include in your main project. This should work, if everything's in the same workspace.




回答2:


Exporting jars from library project through the Properties -> Java Build Path -> Order and Export doesn't actually work at the end: Eclipse is able to compile a dependent project, but jars do not appear in the final apk and you get a runtime exception.




回答3:


Copy the files to your project location, probably in a lib folder. Then try to add the library.



来源:https://stackoverflow.com/questions/8940418/jars-added-to-an-android-library-are-not-getting-referenced-in-the-project

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