hienlt0610
5/5/2020 - 7:07 AM

Android Exclude X86 So Files

We need remove any dynamic library files such as x86, x86_64 in android for reduce APK file size.

That’s how we can do it:

Set abiFilters in file build.gradle that under application module

android {
    defaultConfig {
        ...
        ndk {
            abiFilters "arm64-v8a", "armeabi-v7a"
        }
    }
}

The above configs will keep arm64-v8a and armeabi-v7a, and remove x86, x86_64, mips etc.

If you want to remove x86, x86_64 in release mode only, you should move the above configs to buildTypes:

android {
    defaultConfig {...}
    buildTypes {
        release {
            ndk {
                abiFilters "arm64-v8a", "armeabi-v7a"
            }
        }
    }
}