My Android app project requires doNotStrip
when packaging, but my project configure file is new build configuration file build.gradle.kts
instead of build.gradle
. Most of the tutorials are for build.gradle
.
After I googled and ChatGPT’ed, google gives me the following answer
android {
packagingOptions {
doNotStrip("**/*.so") // Do not strip all *.so files
}
}
and then I rebuild my project there are still ./app/build/intermediates/stripped_native_libs/debug/
directory in my project directory. (I have rm
this dir so I’m sure this dir is newly created, so that’s not working, (still stripped)). As following
/path/to/android/project_dir $ find . -name "*.so"
./app/build/intermediates/merged_native_libs/debug/out/lib/arm64-v8a/lib***.so
./app/build/intermediates/merged_jni_libs/debug/out/arm64-v8a/lib***.so
./app/build/intermediates/stripped_native_libs/debug/out/lib/lib***.so
Then the Android Studio give me suggestions to change packagingOptions to packaging as below
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
jniLibs.keepDebugSymbols += "*/*/libSenseChatLite_shared.so";
jniLibs.keepDebugSymbols += "*/*/libsensitive.so";
jniLibs.keepDebugSymbols += "*/*/libnpjg_a64.so";
}
This still doesn’t work (created an ./app/build/intermediates/stripped_native_libs/debug/
directory)
How can I doNotStrip
these dylibs in this brand new build system?