Repository: flutter/flutter
File: packages/flutter_tools/gradle/src/main/kotlin/FlutterPlugin.kt (Kotlin)

Code before:
                    reset()
                    isUniversalApk = false
                }
            } else {
                // When splits-per-abi is NOT enabled, configure abiFilters to control which
                // native libraries are included in the APK.
                //
                //  If a project includes third-party dependencies with x86 native libraries,
                // without these abiFilters, Google Play would incorrectly identify the app as supporting x86.
                // When users with x86 devices install the app, it would crash at runtime because Flutter's
                // native libraries aren't available for x86. By filtering out x86 at build time, Google Play
                // correctly excludes x86 devices from the compatible device list.
                //
                // This code does NOT affect "add-to-app" scenarios because:
                // 1. For 'flutter build aar': abiFilters have no effect since libflutter.so and libapp.so
                //    are not packaged into AAR artifacts - they are only added as dependencies
                //    in pom files.
                // 2. For project dependencies (implementation(project(":flutter"))): The Flutter
                //    Gradle Plugin is not applied to the main app subproject, so this apply()
                //    method is never called.
                //
                // abiFilters cannot be added to templates because it would break builds when
                // --splits-per-abi is used due to conflicting configuration. This approach
                // adds them programmatically only when splits are not configured.
                //
                // If the user has specified abiFilters in their build.gradle file's . DefaultConfig,
                // those settings will take precedence over these defaults.
                configureAbiWithoutSplits(projectToAddTasksTo, androidExtension)
            }
        }

        /**
         * Clears existing abi configuration and sets ABI's supported by flutter.
         */
        private fun configureAbiWithoutSplits(
            projectToAddTasksTo: Project,
            extension: ApplicationExtension
        ) {
            // Developers can set this value by passing `-P disable-abi-filtering=true`
            // to flutter build. Where "disable-abi-filtering" comes from
            // com.flutter.gradle.FlutterPluginUtils.PROP_DISABLE_ABI_FILTERING.
            if (!FlutterPluginUtils.shouldProjectDisableAbiFiltering(projectToAddTasksTo)) {
                extension.defaultConfig.ndk {
                    abiFilters.clear()
                    abiFilters.addAll(PLATFORM_ABI_LIST)
                }
            }
        }

        /**
         * Finds a task by name, returning null if the task does not exist.

Review comment (suggestion):
```suggestion
                // If the user has specified abiFilters in their build.gradle file's DefaultConfig,
```

Code after:
                    reset()
                    isUniversalApk = false
                }
            } else {
                // When splits-per-abi is NOT enabled, configure abiFilters to control which
                // native libraries are included in the APK.
                //
                //  If a project includes third-party dependencies with x86 native libraries,
                // without these abiFilters, Google Play would incorrectly identify the app as supporting x86.
                // When users with x86 devices install the app, it would crash at runtime because Flutter's
                // native libraries aren't available for x86. By filtering out x86 at build time, Google Play
                // correctly excludes x86 devices from the compatible device list.
                //
                // This code does NOT affect "add-to-app" scenarios because:
                // 1. For 'flutter build aar': abiFilters have no effect since libflutter.so and libapp.so
                //    are not packaged into AAR artifacts - they are only added as dependencies
                //    in pom files.
                // 2. For project dependencies (implementation(project(":flutter"))): The Flutter
                //    Gradle Plugin is not applied to the main app subproject, so this apply()
                //    method is never called.
                //
                // abiFilters cannot be added to templates because it would break builds when
                // --splits-per-abi is used due to conflicting configuration. This approach
                // adds them programmatically only when splits are not configured.
                //
                // If the user has specified abiFilters in their build.gradle file's DefaultConfig,
                // those settings will take precedence over these defaults.
                configureAbiWithoutSplits(projectToAddTasksTo, androidExtension)
            }
        }

        /**
         * Clears existing abi configuration and sets ABI's supported by flutter.
         */
        private fun configureAbiWithoutSplits(
            projectToAddTasksTo: Project,
            extension: ApplicationExtension
        ) {
            if (!FlutterPluginUtils.shouldProjectDisableAbiFiltering(projectToAddTasksTo)) {
                extension.defaultConfig.ndk {
                    abiFilters.clear()
                    abiFilters.addAll(PLATFORM_ABI_LIST)
                }
            }
        }

        /**
         * Finds a task by name, returning null if the task does not exist.
         */
        private fun findTaskOrNull(
            project: Project,