简体   繁体   English

Android Studio 错误:未找到 ID 为“com.google.gms.google-services”的插件

[英]Android Studio Error : Plugin with id 'com.google.gms.google-services' not found

I am new to Android Development.我是 Android 开发的新手。 I am using Firebase in this project but I am getting this error during gradle:build我在这个项目中使用 Firebase,但在 gradle:build 期间出现此错误

Plugin with id 'com.google.gms.google-services' not found.未找到 ID 为“com.google.gms.google-services”的插件。

This is my build.gradle file :这是我的 build.gradle 文件:

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

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.3"

    defaultConfig {
        applicationId "com.health.healthbloom"
        minSdkVersion 17
        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.2.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
    implementation 'com.google.android.material:material:1.2.1'
    implementation 'com.google.firebase:firebase-database:19.5.1'
    implementation 'com.google.firebase:firebase-auth:20.0.1'
    implementation 'com.android.support:support-annotations:28.0.0'
    testImplementation 'junit:junit:4.13'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
    implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.21'
    implementation 'com.hbb20:ccp:2.3.1'
    implementation 'com.chaos.view:pinview:1.4.3'

}

I have tried adding this in Dependencies also :-我也尝试在依赖项中添加它:-

classpath 'com.google.gms:google-services:3.0.0'类路径 'com.google.gms:google-services:3.0.0'

Try adding this to your build.gradle dependencies:尝试将其添加到您的 build.gradle 依赖项中:

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

Also, remove另外,删除

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

from your project/build.gradle and add it to your app/build.gradle.从您的项目/build.gradle 并将其添加到您的 app/build.gradle。

You can also check here for more info https://firebase.google.com/docs/android/setup#manually_add_firebase您还可以在此处查看更多信息https://firebase.google.com/docs/android/setup#manually_add_firebase

您可以简单地从 firebase 中删除所有实现,然后转到“ Tools > Firebase并连接您需要的所有内容而不会头疼

just do a clean build and rebuild it too or else do invalidate cache and restart it will restart your android studio freshly.只需进行clean buildrebuild clean build它,否则invalidate cache and restart它会重新启动您的android studio。

you can find it that in file>invalidate cache and restart would be there你可以发现在文件>无效缓存并重新启动将在那里

Adding this to dependency didn't solve :将此添加到依赖项并没有解决:

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

Try to Add this :尝试添加这个:

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

to the root build.gradle.到根 build.gradle。 Check Go To Setting > Android SDK > SDK Tools > Google Play Service检查Go To Setting > Android SDK > SDK Tools > Google Play Service

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 找不到 ID 为“com.google.gms.google-services”的插件。 [ Android ] - Plugin with id 'com.google.gms.google-services' not found. [ Android ] 找不到插件:“com.google.gms.google-services” - Could not found plugin: 'com.google.gms.google-services' 更新到最新版本 4.3.7 后找不到 ID 为“com.google.gms.google-services”的插件 - Plugin with id 'com.google.gms.google-services' not found after updated to latest version 4.3.7 ID为'com.google.gms.google-services'的错误插件没有最新的类路径 - Error Plugin with id 'com.google.gms.google-services' not foun with latest classpath 无法应用插件“com.google.gms.google-services” - Failed to apply plugin “com.google.gms.google-services” 错误Gradle同步失败:对于输入字符串:“ 12”,应用插件:“ com.google.gms.google-services” - error Gradle sync failed: For input string: “ 12” when apply plugin: 'com.google.gms.google-services' 与Google Instant Game和com.google.gms.google-services插件冲突 - Conflicts with google instant game and com.google.gms.google-services plugin Gradle 同步失败:未找到 ID 为“com.google.android.gms:play-services”的插件 - Gradle sync failed: Plugin with id 'com.google.android.gms:play-services' not found com.google.gms.google-services未添加类GoogleSignInOptions - com.google.gms.google-services not adding class GoogleSignInOptions 错误:找不到com.google.gms:google-services:1.0。在android studio中的build.gradle中添加google服务插件时 - Error: Could not find com.google.gms:google-services:1.0. when adding google service plugin in build.gradle in android studio
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM