gpt4 book ai didi

java - Gradle 同步失败 : Plugin with id 'com.google.android.gms:play-services' not found

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:26:10 26 4
gpt4 key购买 nike

在我的一个项目中,我需要使用 GoogleMapsFirebase 进行通知,但该服务的库和现有的 Firebase 无法正常工作。

buildscript {
repositories {
google()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath 'com.google.android.gms:play-services:8.4.0'
classpath 'com.android.tools.build:gradle:3.0.1'
}
}

allprojects {
repositories {
jcenter()
}
}

buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}

dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
maven { url 'https://maven.fabric.io/public' }
maven { url "https://maven.google.com" }
}

android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.online.app"
minSdkVersion 16
targetSdkVersion 25
versionCode 8
versionName "2.5"
multiDexEnabled true
}
buildTypes {
release {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:support-v4:26.0.2'
compile 'me.leolin:ShortcutBadger:1.1.6@aar'
compile('com.crashlytics.sdk.android:crashlytics:2.6.0@aar') {
transitive = true;
}
compile "com.google.firebase:firebase-ads:11.8.0"
compile "com.android.support:appcompat-v7:26.1.0"
compile 'com.android.support:multidex:1.0.1'
}

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

错误:

Gradle sync failed: Plugin with id 'com.google.android.gms:play-services' not found.
Consult IDE log for more details (Help | Show Log) (2s 325ms)

最佳答案

改变这个:

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

为此:

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

检查此以获取更多信息:https://developers.google.com/android/guides/google-services-plugin

关于java - Gradle 同步失败 : Plugin with id 'com.google.android.gms:play-services' not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48881260/

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