I had created an android library project.Now I am looking to distribute my library project as a jar to the 3rd party for the security of my code. I had searched a lot about how to convert a library project to a jar.But I didn't get the proper solution.So is it possible to convert any library project to jar ?? How can I convert my library to jar ??? please help me with steps , thanks in advance :)
Asked
Active
Viewed 375 times
0
-
possible duplicate of [Create an Android Jar library for distribution](http://stackoverflow.com/questions/5014128/create-an-android-jar-library-for-distribution) – CodingIntrigue Apr 03 '14 at 07:33
-
interesting that you think a jar is more secure... it's basically just a zip containing the .class files - and it's fairly easy to decompile those. – Lovis Apr 03 '14 at 07:33
-
you can export your library project as jar. – Ravneet Singh Apr 03 '14 at 07:35
-
if, the library contains attrs and layouts then in that case it is not appropriate to convert it to a jar. i have tried it myself and the problem is the layout or view(code custom view) will not be available and hence it would throw an error. – Rat-a-tat-a-tat Ratatouille Apr 03 '14 at 08:03
1 Answers
0
in eclipse select your library project
1:right click on project 2: select export 3:java then jar
Select all files, except the AndroidManifest.xml.
Make sure you DON'T select manifest file. Else it will lead to conflict errors.
Now include this JAR file in the build path, and it will work. I did the same.
Let me know if you have any issues.

ibad ur rahman
- 1,381
- 4
- 18
- 40
-
First, **never manually mess with the Eclipse build path**. The proper place for JARs is in `libs/`. Second, your recipe will only work if the Android library project does not contain resources. – CommonsWare Apr 03 '14 at 07:47
-
as you said I export my jar and integrated it to another project.When I run the second project it shows error " Error generating final archive: Found duplicate file for APK: res/drawable-hdpi/ic_launcher5.png " – Bennett Apr 03 '14 at 07:56
-
i show in image. i make jar library from android project library. – ibad ur rahman Apr 03 '14 at 07:56
-
I used resources like layout and xml file in my project.So is it cause error?? – Bennett Apr 03 '14 at 08:56