В вашем <app dir>/android/app/build.gradle
добавьте раздел splits
, как описано здесь: https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split
Базовая конфигурация будет добавить это к вашему 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
}
}
}
Затем просто запустите команду, как написано в документации:
flutter build apk --split-per-abi
Вот список поддерживаемых ABI:
https://developer.android.com/ndk/guides/abis.html#sa
С приведенной выше конфигурацией вы должны получить все поддерживаемые ABI