Android build fails because Gradle cannot find the Flutter Gradle plugin
Plugin 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.
Fix it fast
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.gradle2Match what you see, then jump to its fix
- 1
app/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
flutter.sdk not set in local.propertieslocal.properties does not define flutter.sdkFix - 3
Gradle 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
- 1
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.gradle2Fix
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 --debugConfirmed by docs.flutter.dev
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.properties2Fix
Add the key with the path of your Flutter SDK, then build again.
# android/local.properties
flutter.sdk=/path/to/flutter3Verify
Build the app again.
flutter runConfirmed by docs.flutter.dev
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.gradle2Fix
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 --debugConfirmed by docs.gradle.org
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:
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- QistLockA NestJS and React SaaS driving an Android Device Owner agent that locks financed phones when payments lapse.
- Dispatch ProA real-time logistics platform: Flutter apps, Spring Boot services and a Kafka event pipeline on AWS.
Related fixes
Mobile apps
Flutter warns that the Gradle plugin is applied the old imperative way
Applying Flutter's app_plugin_loader Gradle plugin imperatively using the apply script method is deprecated
The warning means your android folder still loads the Flutter Gradle plugin with apply from or apply plugin lines.
4 causes, each with a fixMobile 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 fixMobile apps
Gradle cannot find com.google.firebase:firebase-analytics-ktx
Required by: project :app
Firebase moved the Kotlin extensions into the main modules and stopped releasing the -ktx modules in July 2025.
2 causes, each with a fixMobile apps
Gradle cannot create LibraryVariantBuilderImpl in a Flutter Android build
Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl
This error appears when the Android Gradle plugin (AGP) cannot run in the Gradle or IDE you use.
3 causes, each with a fixMobile apps
Flutter release build cannot open the keystore: HmacPBESHA256 not available
Algorithm HmacPBESHA256 not available
The keystore is a PKCS12 file protected by a newer algorithm than the Java that is reading it understands.
3 causes, each with a fixMobile apps
Android install error: the package conflicts with an existing package of the same name
The package conflicts with an existing package by the same name
Android allows only one app per application ID, and an update must be signed with the same certificate as the installed version.
3 causes, each with a fix