gpt4 book ai didi

java - 为什么 android studio 显示错误 "Error:(38, 0) Plugin with id ' com.google.gms.google-services' not found”

转载 作者:行者123 更新时间:2023-11-30 00:49:47 24 4
gpt4 key购买 nike

这是我在下面给出的应用程序上的 gradle.build,它显示错误:

Error:(38, 0) Plugin with id 'com.google.gms.google-services' not found.

有没有答案?

应用插件:'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.0"

defaultConfig {
applicationId "com.example.admin.youfame"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard- rules.pro'
}
}
}
repositories {
mavenCentral()
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.android.support:cardview-v7:23.0.0'
compile 'com.android.support:recyclerview-v7:23.0.0'
compile 'com.google.apis:google-api-services-youtube:v3- rev152-1.21.0'
compile 'com.android.volley:volley:1.0.0'
compile 'com.facebook.android:facebook-android-sdk:4.+'
compile 'com.google.firebase:firebase-ads:10.0.1'
compile 'com.google.android.gms:play-services-ads:10.0.1'
}

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

最佳答案

在您的顶级 build.gradle 中添加 google play 服务插件:

buildscript {
repositories {
jcenter()
}
dependencies {
//...
classpath 'com.google.gms:google-services:3.0.0'

}
}

然后你必须在你的模块中添加 google-services.json 文件

root
|--module
|----google-services.json

关于java - 为什么 android studio 显示错误 "Error:(38, 0) Plugin with id ' com.google.gms.google-services' not found”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41244584/

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