【发布时间】:2021-02-27 16:21:10
【问题描述】:
我是 Android 开发新手。我在这个项目中使用 Firebase,但在 gradle:build 期间出现此错误
未找到 ID 为“com.google.gms.google-services”的插件。
这是我的 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'
}
我也尝试在依赖项中添加它:-
类路径'com.google.gms:google-services:3.0.0'
【问题讨论】:
-
插件在你的根级 build.gradle 中配置。请务必遵循文档中的所有说明。 firebase.google.com/docs/android/setup
标签: java android firebase android-studio