I am trying to package the android code into a jar file so that I can use it in another project. But when I do that I get the following error messages. I am not sure how to do this correctly if someone has done it please post a link and some details would be really helpful.
Thanks
Error generating final archive: Found duplicate file for APK: AndroidManifest.xml
Origin 1: C:\Users\Admin\workspace\Test\bin\resources.ap_
Origin 2: C:\Users\Admin\workspace\Test\lib\JarLib.jar
I have to use it in lots of project so I want to compile it as jar just like other libraries available online such as twitter4j, googleAnalytic, androidsupportlibrary and I need to know which folder are compulsory to include in Jar file. I have tried building it by excluding the resources folder and using eclipse->export, though it builds the jar but upon including it in another test project displays the above errors messages.
Better to build as a Library Project. Right click the Project( which is having common code) -> Select Properties -> Select Android Tab ->check isLibrary Option->Ok as shown below :. You can add this as referenced project to another Project by clicking Add button in the above image. Then the Library Projects directory is created having jar file as shown below :
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With