1

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.

1 Answers1

0

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.

Community
  • 1
  • 1
Macarse
  • 91,829
  • 44
  • 175
  • 230