问题
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