gpt4 book ai didi

android - 错误应用插件 : 'com.google.gsm.google-services' also added classpath 'com.google.gms:google-services:4.2.0'

转载 作者:行者123 更新时间:2023-12-03 05:34:01 24 4
gpt4 key购买 nike

我正在使用firebase实时数据库。当我想同步 gradle 时,我收到此错误消息:
未找到 ID 为“com.google.gsm.google-services”的插件。

我已经下载了 google-services.json 并将其添加到项目 View 中的我的应用程序文件夹中
我已经尝试了许多类路径,包括:

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

项目等级:
{buildscript 
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath 'com.google.gms:google-services:4.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
google()
jcenter()

}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

我的模块应用程序是:
apply plugin: 'com.android.application'

android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.esppad.friendlychat2"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}


dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.github.bumptech.glide:glide:3.6.1'
implementation 'com.google.firebase:firebase-database:19.0.0'

}
apply plugin: 'com.google.gsm.google-services'

最佳答案

应用插件:“com.google.gsm.google-services”不得放在依赖项中

在依赖项之后添加它,如下所示,

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.github.bumptech.glide:glide:3.6.1'
implementation 'com.google.firebase:firebase-database:19.0.0'
}

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

关于android - 错误应用插件 : 'com.google.gsm.google-services' also added classpath 'com.google.gms:google-services:4.2.0' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57652829/

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