Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

Android build fails because Gradle cannot find the Flutter Gradle plugin

ErrorPlugin with id 'dev.flutter.flutter-gradle-plugin' not found.

Short answer

The id dev.flutter.flutter-gradle-plugin in app/build.gradle is only resolvable when android/settings.gradle includes the Flutter SDK's gradle build through pluginManagement. Restore the documented settings.gradle with includeBuild, make sure local.properties defines flutter.sdk, and keep pluginManagement and plugins as the first blocks in the file.

  • Applies to Flutter 3.x, Gradle 8, Android Gradle Plugin 8.x
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Open the three files involved and compare them with the Flutter migration page. Start with the top of settings.gradle.

    cat android/settings.gradle
    cat android/local.properties
    head -n 8 android/app/build.gradle
  2. 2Match what you see, then jump to its fix

    1. 1app/build.gradle has id "dev.flutter.flutter-gradle-plugin" in its plugins block, but settings.gradle lacks includeBuildsettings.gradle has no pluginManagement block with includeBuildFix
    2. 2flutter.sdk not set in local.propertieslocal.properties does not define flutter.sdkFix
    3. 3Gradle complains about the position of pluginManagement or plugins, or the plugin loader never runsThe blocks are in the wrong order or the loader has apply falseFix

What does the error look like?

  • Plugin with id 'dev.flutter.flutter-gradle-plugin' not found.
  • flutter.sdk not set in local.properties

Cause 1 of 3

settings.gradle has no pluginManagement block with includeBuild

1Check

Search settings.gradle for includeBuild. The plugin id is provided by the Flutter SDK's packages/flutter_tools/gradle build, and only that line makes it visible to Gradle.

grep -n "includeBuild\|pluginManagement\|flutter-plugin-loader" android/settings.gradle

2Fix

Use the settings.gradle from the Flutter migration guide, substituting your own Android Gradle Plugin and Kotlin versions.

pluginManagement {
    def flutterSdkPath = {
        def properties = new Properties()
        file("local.properties").withInputStream { properties.load(it) }
        def flutterSdkPath = properties.getProperty("flutter.sdk")
        assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
        return flutterSdkPath
    }()

    includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")

    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
    }
}

plugins {
    id "dev.flutter.flutter-plugin-loader" version "1.0.0"
    id "com.android.application" version "{agpVersion}" apply false
    id "org.jetbrains.kotlin.android" version "{kotlinVersion}" apply false
}

include ":app"

3Verify

Run a build and watch for the plugin error to disappear.

flutter build apk --debug

Confirmed by docs.flutter.dev

Did this fix it?

Cause 2 of 3

local.properties does not define flutter.sdk

1Check

The settings.gradle above reads the Flutter SDK path from android/local.properties and stops when the key is missing.

grep "flutter.sdk" android/local.properties

2Fix

Add the key with the path of your Flutter SDK, then build again.

# android/local.properties
flutter.sdk=/path/to/flutter

3Verify

Build the app again.

flutter run

Confirmed by docs.flutter.dev

Did this fix it?

Cause 3 of 3

The blocks are in the wrong order or the loader has apply false

1Check

The Flutter migration page says no other code may come before the pluginManagement and plugins blocks, and that dev.flutter.flutter-plugin-loader must not be marked apply false. Gradle itself requires pluginManagement to be the first block in settings.gradle.

head -n 20 android/settings.gradle

2Fix

Move your custom code below those two blocks and remove apply false from the dev.flutter.flutter-plugin-loader line.

plugins {
    id "dev.flutter.flutter-plugin-loader" version "1.0.0"
}

3Verify

Run the build once more.

flutter build apk --debug

Confirmed by docs.gradle.org

Did this fix it?

How do I stop it coming back?

  • After copying an old project, compare android/settings.gradle with the migration guide before upgrading Gradle.
  • Keep the Flutter SDK path in local.properties current when you move or reinstall Flutter.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Mobile apps

Google Play says the app does not support 16 KB memory pages

check_elf_alignment.sh reports UNALIGNED for a library under lib/arm64-v8a

Google Play requires apps that target Android 15 or higher and ship native .so libraries to run on devices with 16 KB memory pages; from 1 February 2027 it will block updates that do not.

5 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.