0

I have followed this link with no success to solving the issue.

and this Plugin with id 'com.google.gms.google-services' not found

A Screen shot of the error displyed

This is my build.gradle(Module:app)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.1"
    defaultConfig {
        applicationId "example.technerd.com.firebaseauthentication"
        minSdkVersion 16
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    implementation 'com.google.firebase:firebase-analytics:17.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}

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

This is my build.gradle(Project:ProjectName)

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        //google()
        google()  // Google's Maven repository
        jcenter()

    }
    dependencies {
       classpath 'com.android.tools.build:gradle:3.4.2'
      //  classpath 'com.google.gms:google-services:4.3.2'
       // classpath 'com.google.gms:google-services:4.3.2'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
       // google()
        google()  // Google's Maven repository
        jcenter()

    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

What am I missing or what have I added that is incorrect? Please help me solve This is my error.

Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841
Kamau Mbûgua
  • 777
  • 1
  • 10
  • 19
  • Does this answer your question? [Plugin with id 'com.google.gms.google-services' not found](https://stackoverflow.com/questions/38611257/plugin-with-id-com-google-gms-google-services-not-found) – Brandon Stillitano Oct 29 '19 at 17:26

1 Answers1

1

Check the official guide:

In your top-level file you have to add the google play service plugin com.google.gms:google-services:

buildscript {
    repositories {
        google()  
        jcenter()

    }
    dependencies {
       classpath 'com.android.tools.build:gradle:3.4.2'
       classpath 'com.google.gms:google-services:4.3.2'
    }
}
Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841
  • Hi @KamauMbugua.if this or any answer has solved your question please consider [accepting it](https://meta.stackexchange.com/q/5234/179419) by clicking the check-mark. This indicates to the wider community that you've found a solution and gives some reputation to both the answerer and yourself. There is no obligation to do this. – Gabriele Mariotti Oct 30 '19 at 07:22