Could not find an option named “split-per-abi”
In your <app dir>/android/app/build.gradle
add a splits
section as described here: https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split
A basic configuration would be to add this to your build.gradle
android {
...
splits {
// Configures multiple APKs based on ABI.
abi {
// Enables building multiple APKs per ABI.
enable true
// By default all ABIs are included, so use reset() and include to specify that we only
// want APKs for x86 and x86_64.
// Resets the list of ABIs that Gradle should create APKs for to none.
reset()
// Specifies a list of ABIs that Gradle should create APKs for.
include "x86", "x86_64", "armeabi", "armeabi-v7a", "arm64-v8a"
// Specifies that we do not want to also generate a universal APK that includes all ABIs.
universalApk false
}
}
}
Then just run the command as the documentation says:
flutter build apk --split-per-abi
Here is the list of supported ABIs: https://developer.android.com/ndk/guides/abis.html#sa
With the config above you should get all supported ABIs