找不到ID为“ com.google.gms.google-services”的插件打开文件

时间:2019-10-29 17:07:50

标签: android firebase gradle google-play-services build.gradle

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

和这个Plugin with id 'com.google.gms.google-services' not found

A Screen shot of the error displyed

这是我的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'

这是我的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 :(得分:0)

检查official guide

您必须在顶级文件中添加Google Play服务插件 alter table name alter column description set default 'no description'

com.google.gms:google-services