gpt4 book ai didi

java - Android Studio 错误 : Plugin with id 'com.google.gms.google-services' not found

转载 作者:行者123 更新时间:2023-12-04 03:47:51 27 4
gpt4 key购买 nike

我是 Android 开发的新手。我在这个项目中使用 Firebase,但在 gradle:build 期间出现此错误

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


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

}
我也尝试在依赖项中添加它:-

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

最佳答案

尝试将其添加到您的 build.gradle 依赖项中:

classpath 'com.google.gms:google-services:4.3.4'
另外,删除
apply plugin:'com.google.gms.google-services'
从您的项目/build.gradle 并将其添加到您的 app/build.gradle。
您也可以在这里查看更多信息 https://firebase.google.com/docs/android/setup#manually_add_firebase

关于java - Android Studio 错误 : Plugin with id 'com.google.gms.google-services' not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64858522/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com