I want to ship native shared libraries with my apk. I added these shared libraries to the folder src/main/jniLibs/arm64-v8a
. The compiled
apk does include these libraries. I did verify this by checking the contents of unzip build/outputs/apk/debug/app-debug.apk
. These libraries are
at lib/arm64-v8a/
.
However, I cannot find the libraries on my target device. I installed the app via adb install build/outputs/apk/debug/app-debug.apk
. I identified the folder on the target with adb shell pm list packages -f MY_APP
. Although the path /data/app/{PATH1}/{PATH2}/lib/arm64/
does exist, it is empty. The libraries are, however, included in the base.apk
on the target.
I have not modified anything in my app (gradle config or CMake files, for instance) other than storing the libraries at src/main/jniLibs/arm64-v8a/
. I experimented with some teakes in the gradle config but that didn’t help. I cannot find relevant information in the Android documentation, https://developer.android.com/studio/projects/gradle-external-native-builds. I am using Gradle 8.