0

I have made a library project that uses Async and Json/Gson libraries. It is working perfectly fine if I use this project as library project inside another Application Project. I don't want my code to be open to world so I tried to make a JAR of my Library Project. I am getting error that shows that the Async and GSON libraries can not be referenced.

  1. Is my JAR not including the ASYNC and JSON libraries?
    • if not then how to do it? I have Checked the libs folder when exporting Library Project to JAR.
  2. If Jar has included Libraries then why can't it get a reference? Is there any way that I can make a reference to the libraries present inside of the JAR of my library project?

Where am I making a mistake?

Update-1

Ok I have checked by extracting my jar and there is a lib folder there which has all the libraries that I have used in my Library Project.

Update-2

How I am exporting my Library Project as Jar.

  1. Select Project to Export
  2. Chose Jar File
  3. Chose only src and lib folder.
  4. Checked
    • Export generated class files and resources
    • Compress the contents of the JAR file
  5. Chose Destination
  6. Left All other checks as defaults and Finish.
Muneeb Mirza
  • 810
  • 1
  • 17
  • 35
  • 2
    A jar is a zip, you can unzip it by yourself and see what's inside. To make a jar with dependencies, you can use maven shade plugin for example –  Nov 27 '14 at 13:07
  • Updated my question, now point 2 is might be the problem – Muneeb Mirza Nov 27 '14 at 13:09
  • possible duplicate of [Adding a library/JAR to an Eclipse Android project](http://stackoverflow.com/questions/3642928/adding-a-library-jar-to-an-eclipse-android-project) – fabian Nov 27 '14 at 13:12
  • 1
    I don´t think it´s a duplicated, I think you´re doing wrong. Inside a JAR file there cannot be another JAR. You have to build an uberjar... it means you explode all the jars you want to jar together and jar the result into one. BTW I see no utility to that thing as long as the package will be dexed – eduyayo Nov 27 '14 at 16:48

0 Answers0