Short answer
Declare the plugin with a version at the project level, then apply it in the app module. In a plugins-block project, add id("com.google.gms.google-services") version "4.x.x" apply false to the root build.gradle(.kts), or to settings.gradle(.kts) in a current Flutter project, and id("com.google.gms.google-services") to android/app/build.gradle(.kts). In an older buildscript project, add the classpath instead. Make sure google-services.json is in the app folder.
Where the declaration is missing, and the fix
01
Applied in the app, not declared at the project level
“add the Google services Gradle plugin as a dependency” Firebase, Add Firebase to your Android project
The plugin needs two lines: one at the project level that names the version without applying it, and one in the app module that applies it. A tutorial that shows only the app line leaves the first one out.
// project level, ONE place only: android/build.gradle.kts, or android/settings.gradle.kts in Flutter plugins { // keep your existing plugins id("com.google.gms.google-services") version "4.4.2" apply false // example version } // Groovy (build.gradle / settings.gradle): // id "com.google.gms.google-services" version "4.4.2" apply false // android/app/build.gradle.kts plugins { id("com.android.application") id("com.google.gms.google-services") } // Groovy: id "com.google.gms.google-services"02
A Flutter project that uses settings.gradle
“As part of adding Firebase to your Android project, you need to add the google-services Gradle plugin and a google-services.json configuration file to your project.” Firebase, Google services Gradle plugin and JSON config file
Flutter projects created with recent versions declare plugins in android/settings.gradle(.kts), not in a buildscript block. Add the google-services line there with apply false. The FlutterFire CLI (flutterfire configure) adds both lines for you.
// android/settings.gradle.kts (add one line, keep the rest) plugins { id("dev.flutter.flutter-plugin-loader") version "1.0.0" // ...your existing com.android.application and kotlin lines id("com.google.gms.google-services") version "4.4.2" apply false } // android/settings.gradle (Groovy) // id "com.google.gms.google-services" version "4.4.2" apply false03
An older project that uses buildscript
Projects with a buildscript block in the root build.gradle declare the plugin as a classpath dependency and apply it with apply plugin at the bottom of app/build.gradle. Keep the version in one place (the classpath or a plugins block), not both.
// android/build.gradle buildscript { repositories { google() } dependencies { classpath 'com.google.gms:google-services:4.4.2' } } // android/app/build.gradle (last line) apply plugin: 'com.google.gms.google-services'04
The plugin repository isn’t available
Gradle fetches the plugin from Google’s Maven repository. Check that google() is listed in pluginManagement repositories (settings.gradle) or buildscript repositories, and that the build isn’t running offline.
Checked against the vendor’s docs on : Firebase: Add Firebase to your Android project; Firebase: Google services Gradle plugin and JSON config file.
Rather hand it over?
Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.
- from $450App Fix TicketOne reproducible bug in an existing mobile or web app, diagnosed and fixed.See scope and start
- from $450AI-Built App RescueA Lovable, Bolt or Cursor app checked end to end in 3 days, then its worst problems fixed at a fixed price.No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way. This applies to the first 10 Launch Checks bought after October 30, 2026.See scope and start
Related: Firebase “No Firebase App [DEFAULT] has been created” · Google Sign-In DEVELOPER_ERROR on Android · Gradle “Could not resolve all files” · Firebase auth/popup-blocked