Plugin with id 'com.google.gms.google-services' not found
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.
Introduction
This Gradle error means the Google Services plugin could not be resolved during build setup. The root cause is usually missing plugin declaration, missing repository configuration, or incompatible Gradle and Android plugin versions. A stable fix requires choosing one plugin-declaration style and aligning all related versions.
Understand the Two Configuration Styles
Android projects typically use one of two valid plugin configuration styles:
- modern plugins DSL
- legacy
buildscriptclasspath style
Mixing both incompletely is a common reason the plugin cannot be found.
Modern Plugins DSL Setup
For newer projects, declare plugin versions in root and apply plugin in app module.
settings.gradle:
Root build.gradle:
App module app/build.gradle:
This layout is clean and works well in current toolchains.
Legacy Classpath Setup
If project is still on legacy build layout, define classpath explicitly.
Then apply plugin in app module:
If classpath exists but app module does not apply plugin, build still fails.
Repository Resolution Must Include Google Maven
The plugin artifact is on Google Maven. Missing google() in plugin management or buildscript repositories will cause resolution failure even if plugin id is correct.
Minimal repository set in relevant scope:
In restricted network environments, verify proxy and certificate settings for CI agents too.
google-services.json Placement
This error is about plugin resolution, but after fixing it, next failure often comes from missing Firebase config file.
Typical placement:
- '
app/google-services.jsonfor single app module' - variant-specific files for product flavors when needed
Also ensure package name in JSON matches app applicationId for each variant.
Version Compatibility Strategy
Keep these aligned:
- Gradle wrapper version
- Android Gradle Plugin version
- Google Services plugin version
- Kotlin plugin version if used
Use officially compatible ranges from Android and Firebase release notes. Random upgrades of one component frequently break plugin resolution.
Troubleshooting Sequence
Use a consistent debug order:
- verify plugin declaration style in project
- verify
google()repositories in correct scope - verify plugin version declaration and compatibility
- run clean sync and inspect first failing line
- verify CI and local environments use same Gradle wrapper
Useful commands:
Avoid guessing. Fix the first root error in the build output.
CI Pipeline Alignment
Many teams fix this issue locally and still fail in CI because the pipeline uses a different Gradle wrapper, stale build cache, or restricted repository access. Ensure CI checks out wrapper files from repository, does not override Gradle version unexpectedly, and has outbound access to Google Maven. A reproducible build environment is often the final piece after local configuration looks correct.
Common Pitfalls
- Mixing plugins DSL and legacy classpath style inconsistently.
- Declaring plugin in root but never applying it in app module.
- Missing
google()in plugin resolution repositories. - Using incompatible versions across Gradle, AGP, and google-services plugin.
- Fixing local build but forgetting equivalent CI repository and wrapper settings.
Summary
- The error means Gradle cannot resolve the Google Services plugin id.
- Pick one configuration style and apply it consistently.
- Ensure Google Maven repository is configured in correct scope.
- Align build tool versions across local and CI environments.
- After plugin resolution, validate
google-services.jsonplacement and app id alignment.
Related reading
- Populate a database with TestContainers in a SpringBoot integration test
- Populating Spring @Value during Unit Test
- Possibly consider using a shorter maxLifetime value - hikari connection pool spring boot
- Postgres connection has been closed error in Spring Boot
- pod install -bash pod command not found
- Pod install displaying error in cocoapods version 1.0.0.beta.1
- PostgreSQL row change notify java program and vice versa
- POSTing a OneToMany sub-resource association in Spring Data REST

OOD Fundamentals
Master object-oriented design from first principles, SOLID, design patterns, and classic interview problems with hands-on coding.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.