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?