Плагин с идентификатором com.google.gms.google-services не найден Открыть файл - PullRequest
0 голосов
/ 29 октября 2019

Я перешел по этой ссылке, но не смог решить проблему.

и этот плагин с идентификатором com.google.gms.google-services не найден

Снимок экрана с отображенной ошибкой

Это мой build.gradle (Модуль: приложение)

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'

Это мой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
}

Что мне не хватает или что я добавил, что неправильно? Пожалуйста, помогите мне решить Это моя ошибка.

1 Ответ

0 голосов
/ 29 октября 2019

Проверьте официальное руководство :

. В файл верхнего уровня необходимо добавить плагин сервиса Google Play 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'
    }
}
...