gpt4 book ai didi

android - 找不到 “ERROR: Plugin with id ' com.google.gms.google-services”错误

转载 作者:行者123 更新时间:2023-12-03 06:28:27 26 4
gpt4 key购买 nike

突然我无法构建我的android应用程序。
以下是我的应用程序级别build.gradle

apply plugin: 'com.android.application'

android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
applicationId "com.udayrepo.classelearn"
minSdkVersion 16
targetSdkVersion 28
versionCode 20
versionName "0.5.6"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true

}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
}

android {
lintOptions {
warning 'DuplicatePlatformClasses'
}
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-config:11.8.0'
implementation 'com.google.firebase:firebase-ads:15.0.0'
implementation 'com.google.firebase:firebase-messaging:17.0.0'
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.google.android.gms:play-services-ads:11.8.0'
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
implementation 'com.google.apis:google-api-services-youtube:v3-rev206-1.25.0'
implementation 'junit:junit:4.12'
implementation files('libs/YouTubeAndroidPlayerApi.jar')
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.android.support:cardview-v7:28.+'
implementation('com.foursquare:foursquare-android-oauth:1.0.3') {
exclude group: 'com.google.android'
}

implementation 'com.android.volley:volley:1.1.1'

}
apply plugin: 'com.google.gms.google-services'
以下是我的项目级别guild.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google() // <--here
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
}

allprojects {
repositories {
google() // <-- here
jcenter()
}
}
当我同步时,出现以下错误:
错误:找不到ID为“com.google.gms.google-services”的插件。

最佳答案

您必须将 google-services plugin添加到build.gradle文件中。
在顶级文件中添加:

buildscript {
//....
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.3.3'
}
}

关于android - 找不到 “ERROR: Plugin with id ' com.google.gms.google-services”错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63489531/

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