根据这个线程,我知道有版本冲突,但问题仍然存在后,从谷歌的新版本。
错误:请通过更新谷歌服务插件的版本(有关最新版本的信息可在https://bintray.com/android/android-tools/com.google.gms.google-services/上找到)或将com.google.android.gms版本更新到12.0.1来修复版本冲突。
My build.gradle(模块: app)
....
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'
现在需要做哪些更改?
发布于 2018-06-02 23:44:12
您必须使用implementation
而不是compile
。
并使用这个gradle库,我已经检查过我的pc了。
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:
repositories {
maven{
url "https://maven.google.com"
}
google()
jcenter()
}
查看截图以更好地了解:
https://stackoverflow.com/questions/50658406
复制相似问题