[英]Error: fix the version conflict (google-services plugin) using productFlavors
[英]Error: fix the version conflict (google play services) Kotlin
根据这个SO线程,我知道存在版本冲突,但是在从Google获得新版本后问题仍然存在。
错误:请通过更新google-services插件的版本来解决版本冲突(有关最新版本的信息, 请访问https://bintray.com/android/android-tools/com.google.gms.google-services / ),或将com.google.android.gms的版本更新为12.0.1。
我的build.gradle(模块:应用)
....
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'
现在需要进行哪些更改?
您必须使用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
添加存储库:
repositories {
maven{
url "https://maven.google.com"
}
google()
jcenter()
}
查看屏幕截图以更好地了解:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.