Is there a way, how to add custom library to android app. If I add non-android library to my project it throws error "Only Android project can be add as dependency" and if I reference Android Library to Java Application it throws "This project cannot be added because it does not produce a JAR file using an Ant script." the point is, that I want to keep code on one place (library) and reuse it.

有帮助吗?

解决方案

Your best bet is :

1.Create a folder called libs in your project's root folder
2.Copy your JAR files to the libs folder
3.Now right click on the Jar file and then select Build Path > Add to Build Path, which will create a folder called 'Referenced Libraries' within your project
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top