首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >错误:修复版本冲突(google play服务) Kotlin

错误:修复版本冲突(google play服务) Kotlin
EN

Stack Overflow用户
提问于 2018-06-02 23:28:01
回答 1查看 686关注 0票数 2

根据这个线程,我知道有版本冲突,但问题仍然存在后,从谷歌的新版本。

错误:请通过更新谷歌服务插件的版本(有关最新版本的信息可在https://bintray.com/android/android-tools/com.google.gms.google-services/上找到)或将com.google.android.gms版本更新到12.0.1来修复版本冲突。

My build.gradle(模块: app)

代码语言:javascript
复制
....
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    implementation 'com.google.firebase:firebase-core:11.8.0'
    implementation 'com.google.firebase:firebase-auth:11.6.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'
    compile 'com.google.android.gms:play-services:12.0.1'
}

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

现在需要做哪些更改?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-06-02 23:44:12

您必须使用implementation而不是compile

并使用这个gradle库,我已经检查过我的pc了。

代码语言:javascript
复制
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:1.2.41"
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.google.firebase:firebase-core:15.0.2'
implementation 'com.google.firebase:firebase-auth:15.0.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:12.0.1'

同样在项目级 build.gradle add repositories:

代码语言:javascript
复制
repositories {
maven{
    url "https://maven.google.com"
}
    google()
    jcenter()
}

查看截图以更好地了解:

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50658406

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档