It appears that my libraries no longer exist in nativeLibraryDir after updating Gradle from 5.4.1 to 5.6.4 and Android Studio from 3.5.3 to 3.6.1. My current implementation for accessing my libraries is as follows:
File libDirectory = new File(context.getApplicationInfo().nativeLibraryDir);
String files[] = libDirectory.list();
Before the update, I can debug and see that the 'files' array contains a list of all my libraries as expected. After the update, the 'files' array appears empty.
I have analyzed my APK and confirmed that the libraries do exist in the package.
Am I retrieving the path in a poor fashion? Is there required permissions that I am not aware of? I am using CMake to build my libraries:
externalNativeBuild {
cmake {
path '../../../common/CMakeLists.txt'
}
}
Using NDK version 21.0.6113669
Update: Reverting to NDK r19c produces the same results
Update: libDirectory
resolves to /data/app/com.example.application-1/lib/arm before and after the update
Update: setting android.useNewApkCreator=false
in gradle.properties produces the same result
Update: Using the Device File Explorer, I am able to view the libraries within the lib/arm/ folder prior to the update. After the update, the lib/arm/ folder is still the same size (4KB), but I am no longer able to view the content within the folder. Folder permissions appear to be unchanged.