title: Reflection using DexClassLoader while linked to external JAR library
body: <p>I am trying to put together a plugin architecture for an Android application. I have a host application that will examine a directory for apk "plugin" files, load them in a DexClassLoader, and invoke a method to get an array of DerivedLibraryObjects.</p>
  
  <p>I think the issue is that the DerivedLibraryObject extends a base class that is contained in an external JAR library. So both the host and the plugin reference this JAR. When I try to get the array of DerivedLibraryObjects I get the following exception:</p>
  
  <pre><code>04-01 14:26:57.996: ERROR/AndroidRuntime(23386): java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation
  </code></pre>
  
  <p>From what I gather, this means that object in the plugin does not match the object in the host. However, both the host and plugin applications link to a copy of the same exact jar file. If I return an object that simply extends Object, then the code works fine, but as soon as I start dealing with a DerivedLibraryObject it throws this error.</p>
  
  <p>Does anyone have any suggestions?</p>