1

I am writing an android Native project which generate an executable file (compiled with both ndk r10e and ndk r12b), and when i try to run the generated executable it generates an error that it is not able to open it:

dlopen failed: library "libtest.so" not found

Obviously "/my/system/path/libtest.so" exist and has the right permissions ( 666 for example ).

This appens only in one of my devices. I have tested it in more than 10 devices and it seems to run perfectly.

I am not able to find out why this error is coming.

Please help me.

mrpep
  • 131
  • 3
  • 12
  • I'm guessing libtest.so is in /system/lib directory, right? Could you tell us more about your devices. AFAIK Android 6.0 doesn't allow non-standard system libraries to be used in apps. – Andrew Oct 07 '16 at 09:18
  • Sorry, /my/system/path/ is not /system/lib but a generic path such as /data/local/temp or another one. The device is a rooted Android 5.1.1 – mrpep Oct 07 '16 at 09:56
  • Are you calling `dlopen` with the absolute path to the library, or just the name and expecting it to find things in the local directory? – Dan Albert Oct 07 '16 at 19:28
  • I have tried first with absolute path and then just by name – mrpep Oct 12 '16 at 10:11

1 Answers1

0

Probably the easiest way to work out exactly what's going on is to use strace. This will show you where it's trying to look for your libtest.so and why it's not finding it. See this answer for how to use strace on android.

Community
  • 1
  • 1
UKMonkey
  • 6,941
  • 3
  • 21
  • 30