I have an android project with several dependencies. Two of them (let\'s call them dependency A and B) have native libraries (.so files).
Dependency A has the following
Try a clean build, I didn't and it was still picking up the files from the previous build. I ended up deleting my app/build/ folder just to be sure.
android {
packagingOptions {
exclude 'lib/armeabi-v7a/libSomeLibYouDontWant.so'
}
}
Worked for me on an app that was previously crashing.
An alternative would be to use
android{
defaultConfig{
ndk{
abiFilters "armeabi", "x86"
}
}
}
There are some similar questions which might be helpful
Gradle exclude arm64 libs
How to use 32-bit native libraries on 64-bit Android device