Adding jar files to a project
Monkey Targets Forums/Android/Adding jar files to a project
| ||
Anyone know how to do this with a monkey project? I've tried adding jars to the "libs" directory without any luck... Or even adding java source code to be built (imported by modules) would do. |
| ||
I also tried extracting to full sources to the src directory, but it is being deleted on each build... The problem is, adding imports in a module won't compile if i add jar's in the libs dir of the project... now where do i put a jar file (or java source code) to be imported in my module? |
| ||
Have the same problem and no resolution yet. You have to alter the ANT xml build files to include more stuff. |
| ||
The jar file i added to the libs directory, is actually being dex'ed into the final apk, althought to no use it seems... seems like adding jars to the classpath at compile would do the trick... But where do you add that? (javac -cp jarfile.jar) .. ? Maybe that will be the end of this: [echo] Resolving Dependencies for MonkeyGame... [dependency] Library dependencies: [dependency] No Libraries I hereby request a solution to this :) (pokeing mark) |
| ||
Ok I found a temporary solution to the problem. Which is having ant copy java source files to the src/ directory... Ant will do this every time you build... Add this to your project's build.xml file (not the ant one): Copy whole directory: <copy todir="src"> <fileset dir="libs/extjavasources/src"/> </copy> javac then compiles all the java files copied... It will work for using external sources with modules. |
| ||
Thanks for that! :) |