How to link so library from optee client app with android ndk in Android 9


I developed an Android Native Apk. Firstly, I generated an so file ( as using native library. Then, I installed it to /vendor/lib64 . Because, it uses another library ( in /vendor/lib64 .

Secondly, I installed my app as system apk in /system/app . I call in my code like this:


But, my apk can’t load ( library. And, Error:

java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file “/system/app/MyTeeApp/MyTeeApp.apk”],nativeLibraryDirectories=[/system/app/MyTeeApp/MyTeeApp.apk/lib/arm64, /systemapp/MyTeeApp/MyTeeApp.apk!/lib/arm64-v8a, /system/lib64, /system/lib64]]] couldn’t find “”

In previos Android version, my app worked correctly. Because, and are in /system/lib64 folder. So, android app could load and this library can use

In Android 9, is just in /vendor/lib64 .

I searched some examples in Google. In a lot of examples, nativeLibraryDirectories includes vendor/lib64 folder. But, in my example there is no /vendor/lib64 directory. (please, look at the error)

How can I link to /vendor/lib64 directory from my app or how can Android system show /vendor/lib64 for loading library? selinux policy can block /vendor folder for loading library.