Open AlienKevin opened 6 months ago
On iOS this is controlled by XCode build. For example during debug on XCode the "Build Active Architecture Only" option is usually set, in which case cargokit should only build one architecture.
On android the target platforms being build are obtained from flutter plugin. I'm not sure if there is a way to adjust that.
So, it is possible to disable certain arch in flutter android,
android {
...
defaultConfig {
...
ndk {
abiFilters "armeabi-v7a", "arm64-v8a"
}
}
}
cc: @knopp
You can also skip the steps for building extra android architectures by updating cargokit/gradle/plugin.gradle
. The following example shows how to only compile for arm64:
...
def platforms = plugin.getTargetPlatforms().collect()
// Only compile for arm64 on Android
platforms = platforms.findAll { it == "android-arm64" }
// Comment out the following lines which add intel targets in debug mode
// Same thing addFlutterDependencies does in flutter.gradle
// if (buildType == "debug") {
// platforms.add("android-x86")
// platforms.add("android-x64")
// }
Currently, cargokit always builds for all supported architectures. For example, there are 3 targets for iOS and 4 targets for Android.
However, many devs test primarily on one device during development and only need to build for all architectures during release. This means that a lot of build time is wasted on architectures that the devs don't need, slowing down the development cycle.
It'd be great if devs can whitelist/blacklist target architectures in dev mode to cut down unnecessary build time.