0

I've made a jni library that dynamically loads plugins using dlopen, plugin library files have a different naming e.g. zzz_abc.so.

eclipse and ant are correctly bundling these files in the apk, but the android packagemanager only unpacks files named libxxx.so, other filename patterns are ignored, perhaps in debug, gdbserver is added and unpacked on my 4.1 phone (but not on 4.4 genymotion emulator).

There is something "magic" to control this behavior?

sherpya
  • 4,890
  • 2
  • 34
  • 50

2 Answers2

1

I've verified and unfortunately the native library installer only copies filenames like libxxx.so and gdbserver, if someone is interested the code is in frameworks/base/core/jni/com_android_internal_content_NativeLibraryHelper.cpp.

Jay Conrod
  • 28,943
  • 19
  • 98
  • 110
sherpya
  • 4,890
  • 2
  • 34
  • 50
  • [Right](http://stackoverflow.com/a/17384650/192373). The Package Manager on device looks for `^lib.+\.so$` pattern when it copies native libraries to `/data/data/your.package.name/lib`. – Alex Cohn May 12 '14 at 11:31
0

Android Package Manager copies libraries according to device processor architecture (armv7a, armv6, x86, mips). So if you use x86 based emulator, you need to provide x86 build of your library.

Ernest Poletaev
  • 558
  • 5
  • 15
  • gdbserver is not copied because of a bug in genymotion 4.4 image, there is a patched `libandroid_runtime.so` around – sherpya May 30 '14 at 13:54