Common jar files for Android project and library

I have an Android app that is shared in an Android library and a regular Android project. Using the new r14 SDK, the library project is compiled separately. My library and project use an external jar file (joda-time), where do I put the jar file jode-time? If I put it in the lib library folder and the folder with my applications, I will get a dex error by adding an already added class.

+4
source share
2 answers

Take a look at the article Changes in library projects in Android SDK Tools, r14 I think you can find the answer there

+1
source

I had the same question. Here is how I developed it:

In the library project:
- copy the jar file to the / libs directory
- add the jar to the assembly path (right-click on the jar, select "Assembly path", add the assembly path)
- export the jar to make it visible to dependent projects (right-click on the jar, select "Configure assembly path", tab "Order and Export", check the jar)

In a dependent project:
- add the jar to the build path of the project (right-click on the project, select "Configure build path", the "Libraries" tab, "add JAR" and go to the jar file in the library project)

0
source

All Articles