Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to apply plugin "com.google.gms.google-services"

Here is my project build.gradle:

buildscript {
    ...
    dependencies {
        ...
        classpath 'com.google.gms:google-services:3.1.0'
    }
}

In one of the module's build.gradle I have this:

apply plugin: 'com.google.gms.google-services'

which results into the following error:

Could not get unknown property 'LibraryVariants' for object of type com.android.build.gradle.LibraryExtension.

Fun fact, if I set google-services version to 3.0.0, this specific error disappears, but Gradle asks me to downgrade versions of other google libraries, but I really do not want to do that.

How do I deal with these LibraryVariants?

like image 384
Daniil Orekhov Avatar asked Jul 13 '17 23:07

Daniil Orekhov


People also ask

What is the use of Google-services json?

The google-services. json file created in this doc is used within your app to connect to firebase and facilitate Android Push Notifications and is normally labelled google-services. json.


1 Answers

You only set apply plugin: 'com.google.gms.google-services' in the app module, and in no other modules.

like image 50
Muz Avatar answered Sep 29 '22 19:09

Muz