2

I am loading the dex file from an APK dynamically using DexClassLoader and the APK contains native libraries also packaged in the following paths,

library.apk
    ├── classes.dex
    ├── lib
         ├── armeabi-v7a
                 ├── libNativeLib.so

The DexClassLoader accepts an filePath to search for native libraries to load,

DexClassLoader (String dexPath, 
               String optimizedDirectory, 
               String librarySearchPath, 
               ClassLoader parent)`

librarySearchPath String: the list of directories containing native libraries, delimited by File.pathSeparator; may be null

But this search path only seems to accept the filesystem path.

Is there a way to provide a native library search path inside the APK directly or should I manually extract the native libraries to some location and provide the extracted path?

Codebender
  • 14,221
  • 7
  • 48
  • 85
  • Were you ever able to find a solution to this issue? Thanks! – Jens Zalzala Dec 21 '16 at 22:40
  • @anakin78z, I extracted the native libraries to data dir and provided that path. – Codebender Dec 22 '16 at 10:21
  • @Codebender a little late to the party but could you provide an implementation example for the solution you came up with please? i'm facing the same issue at the moment. how did you link the native libs to the interface at runtime? – davy307 Oct 28 '19 at 11:21

0 Answers0