gpt4 book ai didi

java - 错误 "Please fix the version conflict either by updating the version of the google-services"

转载 作者:太空狗 更新时间:2023-10-29 15:50:02 24 4
gpt4 key购买 nike

(translated with Google translator) 我在网上查了下,到处都是build.gradle里改版本的。请帮帮我。 我已准备好更新 gms 插件,但我该怎么做呢?

Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 16.0.1.

我的项目gradle:

buildscript {

repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.google.gms:google-services:3.1.1'
}
}

allprojects {
repositories {
google()
jcenter()
}
}

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

我的模块等级:

apply plugin: 'com.android.application'

android {
compileSdkVersion 'Google Inc.:Google APIs:14'
defaultConfig {
applicationId "com.xxx.xxxxxxxx"
minSdkVersion 14
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.google.firebase:firebase-core:11.8.0'
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.google.android.gms:play-services-gcm:15.0.1'
}

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

最佳答案

改变这个:

classpath 'com.google.gms:google-services:3.1.1'

进入这个:

classpath 'com.google.gms:google-services:4.0.1'

避免混合版本错误。

还将 firebase-core 依赖项更新为:

implementation 'com.google.firebase:firebase-core:16.0.1'

https://firebase.google.com/support/release-notes/android

关于java - 错误 "Please fix the version conflict either by updating the version of the google-services",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51270635/

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