I have two apps A and B. App A uses DexClassLoader
to load a custom view class from app B. This works fine.
However if the custom view in app B loads private native libraries bundled with apk B via java.lang.System.loadLibrary
and dalvik.system.PathClassLoader
. Then I get
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.example.app-b-xxx==/base.apk"],nativeLibraryDirectories=[/system/lib, /vendor/lib]]] couldn't find "my_native_lib.so"
If I start app B by itself, it is able to load the private native libraries just fine.
Is this supported? I know that DexClassLoader
only loads classes, but can those loaded classes then call into their own bundled native libs?