未找到插件 [id: 'com.google.gms.google-services']
Posted
技术标签:
【中文标题】未找到插件 [id: \'com.google.gms.google-services\']【英文标题】:Plugin [id: 'com.google.gms.google-services'] was not found未找到插件 [id: 'com.google.gms.google-services'] 【发布时间】:2021-12-22 22:32:24 【问题描述】:当我尝试将云 Firestore SDK 添加到您的应用时,它会显示一个错误。
错误: enter image description here
bulid.gradle
项目的图片:
enter image description here
project.setting 的图片: enter image description here
请帮帮我...
plugins
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'com.google.gms.google-services'
android
compileSdk 31
defaultConfig
applicationId "com.example.faltu3"
minSdk 16
targetSdk 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
buildTypes
release
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
compileOptions
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
kotlinOptions
jvmTarget = '1.8'
dependencies
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
implementation 'com.google.firebase:firebase-firestore:24.0.0'
implementation 'com.android.support:support-annotations:28.0.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
【问题讨论】:
【参考方案1】:您需要在 build.gradle(projectname) 中添加以下依赖项 " 类路径 'com.google.gms:google-services:4.3.10' "
以及 build.gradle(:app) 中的“应用插件:'com.google.gms.google-services'”
【讨论】:
以上是关于未找到插件 [id: 'com.google.gms.google-services']的主要内容,如果未能解决你的问题,请参考以下文章
未找到 ID 为“org.springframework.boot”的插件