1

My app requires, Microphone access to record audio. App also uses some native libraries. The app is working fine for targetSdkVersion set to less than or equal to 22. I want to run my app on Android Marshmallow.
I get following error on Android M:

dlopen failed: library "libxyz.so" not found

Following steps lead to error:

  1. Launch app. App asks for Microphone permissions. Grant permission
  2. Go to Device Settings & revoke microphone permission (App restarts on Android M)
  3. Now re-grant Microphone access to the app.
  4. Go to app. When I try to capture audio now, I hit the dlopen error.

On the other hand though, if I launch app, grant permissions & capture audio everything works fine. Issue seems to be with revoking/re-granting permissions(steps 2-3-4 above). If I only do step 1 above, android is able to load the native library & everything works seamlessly. This clearly confirms that, there is no issue with packaging & libs are available.

I have already read this: http://developer.android.com/about/versions/marshmallow/android-6.0-changes.html
My native lib doesnt have "text relocations"(they are built with fPIC flag). Moreover when dlopen() fails, dlerror() is NULL, which is not very helpful.I also used "eu-findtextrel" utility to confirm none of my native libs have "text relocations"
I have also read these posts: Android M crash java.lang.UnsatisfiedLinkError: dlopen failed:
Unable to dlopen(libsomething.so) Cannot load library: link_image[1995]: failed to link libsomething.so
https://android.stackexchange.com/questions/92473/dlopen-failed-library-system-lib-libhoudini-so-not-found
Since none of the above have helped me, I am posting my query. Any help will be highly appreciated

Community
  • 1
  • 1
Ganesh kudva
  • 990
  • 3
  • 13
  • 34

0 Answers0