Contrary to many other posts on this topic, I want to exclude a native library from an Android build with Gradle.
libfoo.so
resides in a library project in the default directory thelib/src/main/jniLibs
. In my main project's build.gradle I try to exlude the file as follows:
sourceSets {
all{
jniLibs {
exclude '**/libfoo.so'
}
}
}
This does not work though, the file is still in the final APK. I tried different path specifications already, but none of them work.
Is this even possible, or is there a workaround?
I know this is an old question, i solved my problem with the following
packagingOptions {
exclude 'lib/arm64-v8a/libfoo.so'
}
Hope it helps someones...
Note: On further searching someone had already solved a similar issue; Gradle exclude arm64 libs
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With