简体   繁体   中英

Convert android library project to jar file with resources (libs and build folder)

I make an android library project. It has some jar files and .so files.

  1. I export this project as jar file
    • File->export->jar file->check my project with all folders and files,
    • uncheck AndroidManifest.xml,
    • check Export all output folders for check project
    • check Export java source files and resources
    • -> finish.

But when I add to my another project(libs folder) and add this on javaBuildPath, after run in the log cat show "NoClassDefFound Error (one of the jar file)". How can I fix this problem?

Edit: I'm using Eclipse IDE

Please follow the steps:

1- Right Click on Project –> Export —> Java –> JarFile

2-Select only the src checkbox ie the (pacakages) in Top-Left Window. Don't Select anything in Top-Right Window if some thing is selected remove marks .

3-Select Only Export generates Class Files and Resources

4-In Options Select only Compress the contents of the jar file (it's not important)

To add your External Jar to Your File

1-Right click on project –> Select Properties –> Java Build Path —> libraries –> Add External Jar Files –> Click OK

2-CLEAN your Project

Must clean and build.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM