[Fixed] Error:Could not find com.google.gms: google-services:4.3.15? – Android

by
Ali Hasan
android android-gradle-plugin android-studio dart flutter

Quick Fix: Update your classpath to classpath 'com.google.gms:google-services:4.3.15' with correct package name com.google.gms

The Solutions:

Solution 1:Typo Correction

The provided `build.gradle` in the question has a typo. The `classpath` dependency for the google-services plugin is incorrectly specified as `com.google.gms.google-services`. It should be corrected to `com.google.gms:google-services` instead. Here’s the modified line:

   classpath 'com.google.gms:google-services:4.3.15'

Solution 2: Add the Plugin and Classpath

In your root-level `build.gradle` file, add the following code to apply the Google Services plugin and specify the correct Google Services classpath version:

apply plugin: "com.google.gms.google-services"
classpath("com.google.gms:google-services:4.3.15")

Ensure that the plugin you apply starts with gms.google and that the classpath module you specify is gms:google. Additionally, move your google-services.json file to the app directory.

These changes will enable your project to correctly configure the Google Services plugin and resolve the dependency issue.

Solution 3: Downgrade to 4.3.5

If the previous solutions do not resolve the issue, consider downgrading the version of com.google.gms.google-services to 4.3.5. Replace the existing version in both build.gradle files with the following:

classpath 'com.google.gms:google-services:4.3.5'

Q&A

We have a typo in classpath in build.gradle(root)

It should be classpath 'com.google.gms:google-services:4.3.15' instead of classpath 'com.google.gms.google-services:4.3.15'

How does the updated build.gradle looks like ?

You can try, apply plugin: "com.google.gms.google-services"
classpath("com.google.gms:google-services:4.3.15")

Is switching to old versin can fix the problem ?

You can try, classpath 'com.google.gms:google-services:4.3.5'

Video Explanation:

The following video, titled "Error:Could not find com.google.gms: google-services:4.3.15 ...", provides additional insights and in-depth exploration related to the topics discussed in this post.

Play video

Error:Could not find com.google.gms: google-services:4.3.15? I hope you found a solution that worked for you 🙂 The Content (except music ...