Goal
I want the libs present in my APK to be available on my device from a fixed location when I install my APK.
I opened another question about this issue based on my existing project. This time, I started a brand new project from scratch in order to reduce the unknowns and make my question simpler to resolve.
Steps I followed
With Android Studio 4.0.1, I do the following:
Start a new Android Studio project
Select Native C++
Set project name to test
Select Java as language
Use default toolchain
Build -> Make Project
Under the project view, I verify that my app-debug.apk
has a lib
folder containing a few subdirectories, each with at least the libnative-lib.so
that was built for this project accordingly to the default CMakeLists.txt rules.
I would like this .so to be accessible from my device when I install my APK (I have a more complex project in which I create .so that I want accessible from outside the APK).
However, from my project folder, when I run:
c:\Users\xxx\AndroidStudioProjects\test>adb install app\build\outputs\apk\debug\app-debug.apk
Performing Streamed Install
Success
c:\Users\xxx\AndroidStudioProjects\test>adb shell ls /data/data/com.example.test
cache
code_cache
Other changes I tried
None of the following further changes allowed me to see additional files under /data/data/com.example.test
Added
android.bundle.enableUncompressedNativeLibs=false
togradle.properties
Added
android { ... sourceSets.main { jniLibs.srcDirs = ['libs'] jni.srcDirs = [] }
to
build.gradle
do not change anything to this.Added
set(distribution_DIR ${CMAKE_SOURCE_DIR}/libs)
toCMakeLists.txt