JAR interdependencies in Android

Question!

I have an android app that reads some classes from external JARs at runtime. I am using the PathClassLoader.

I'm getting an instantiation exception with classes in JARs that depend on things in other JARs. In Android I can't find any way to add multiple sources for a classloader that works, nor does chaining the classloaders together as child and parent seem to work.

I could move all the classes into one JAR for my deployment, or maybe unpack all the classes at runtime, however it would be far better if I could find some more convenient and less 'brute force' way to solve this.

Thanks in advance for any info.



Answers

Take into account that android's dalvik VM is not the same as the java one. Check this question.

In an Android application you place all your jars in /lib/ and the compiler will take care of placing them correctly in the dex file.

By : Macarse


This video can help you solving your question :)
By: admin