Flutter's Android build stops: Plugin [id: 'com.google.gms.google-services'] was not found
Your error
Plugin [id: 'com.google.gms.google-services'] was not found in any of the following sources:2 more lines it can showFix it fast
Most common cause, 1 of 2settings.gradle has no versioned entry for the plugin
Add the plugin to the plugins block of the settings file, next to the entries Flutter already put there.
// android/settings.gradle (Groovy)
plugins {
// keep the existing flutter-plugin-loader, AGP and Kotlin lines
id "com.google.gms.google-services" version "4.6.0" apply false
}
// android/settings.gradle.kts (Kotlin DSL)
plugins {
// keep the existing lines
id("com.google.gms.google-services") version "4.6.0" apply false
}Short answer
Plugin [id: 'com.google.gms.google-services'] was not found means Gradle got the id with no version. Since Flutter 3.16 the version is declared once in android/settings.gradle with apply false, and android/app/build.gradle names only the id. Add that settings line, or finish a half-done migration that left apply plugin behind. Applies to Flutter 3.50 and plugin 4.6.0.
Which cause do you have?
Search the three Android Gradle files for the plugin. No versioned line in settings.gradle(.kts) points to cause 1. An apply plugin line in the app file with no classpath line in android/build.gradle points to cause 2.
grep -n "google-services" android/settings.gradle* android/build.gradle* android/app/build.gradle*Then find the line you see in this list and open its fix:
- 1settings.gradle has no versioned entry for the plugin
android/app/build.gradle lists id "com.google.gms.google-services" in its plugins block, settings.gradle has no line for it, and the error shows the version-number note - 2An old apply plugin line is still in the app module
android/app/build.gradle still says apply plugin: 'com.google.gms.google-services', while android/build.gradle has no classpath "com.google.gms:google-services:..." line left
What does the error look like?
Plugin [id: 'com.google.gms.google-services'] was not found in any of the following sources:Plugin Repositories (plugin dependency must include a version number for this source)Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
Cause 1 of 2
settings.gradle has no versioned entry for the plugin
You seeandroid/app/build.gradle lists id "com.google.gms.google-services" in its plugins block, settings.gradle has no line for it, and the error shows the version-number note
Check
Gradle needs a community plugin's full id together with a version. A plugins block in the settings script sets that default version so build scripts can use the bare id, and Flutter's migration guide places com.google.gms.google-services there with a version and apply false. Without that line the app module asks for a plugin Gradle has no version for.
grep -n "plugins" -A8 android/settings.gradle*Fix
Add the plugin to the plugins block of the settings file, next to the entries Flutter already put there. Use the Kotlin form if your project has settings.gradle.kts.
// android/settings.gradle (Groovy)
plugins {
// keep the existing flutter-plugin-loader, AGP and Kotlin lines
id "com.google.gms.google-services" version "4.6.0" apply false
}
// android/settings.gradle.kts (Kotlin DSL)
plugins {
// keep the existing lines
id("com.google.gms.google-services") version "4.6.0" apply false
}Verify
The build gets past Gradle configuration and produces an APK.
flutter build apkConfirmed by docs.flutter.dev
Cause 2 of 2
An old apply plugin line is still in the app module
You seeandroid/app/build.gradle still says apply plugin: 'com.google.gms.google-services', while android/build.gradle has no classpath "com.google.gms:google-services:..." line left
Check
Gradle's legacy apply plugin form only works for a plugin that a buildscript block put on the classpath. Flutter's migration removes the classpath line from android/build.gradle and the apply plugin line from android/app/build.gradle together; removing only the classpath leaves the apply line pointing at a plugin nothing provides.
grep -n "apply plugin" android/app/build.gradleFix
Finish the migration. Delete the apply plugin line, add the id to the app module's plugins block, and keep the versioned entry from cause 1 in settings.gradle.
// android/app/build.gradle
plugins {
id "com.android.application"
id "dev.flutter.flutter-gradle-plugin"
id "org.jetbrains.kotlin.android"
id "com.google.gms.google-services"
}
// remove: apply plugin: 'com.google.gms.google-services'Verify
grep finds no apply plugin line for google-services, and the app builds and starts.
flutter run --debugConfirmed by docs.gradle.org
How do I stop it coming back?
- Keep every plugin version for the Android side in android/settings.gradle(.kts), so app/build.gradle only lists ids.
- When a Firebase or FlutterFire guide shows the older buildscript classpath style, translate it to the settings plugins block instead of mixing both.
- Build the Android target in CI on every change to files under android/, so a broken plugin declaration fails before release.
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 on the same stack: TaxiDex, QistLock, Dispatch Pro.