我已经搜索了很多解决方案,但是没有一个适合我的情况。我在Gradle Sync上收到此错误:
错误:任务':app:processDebugGoogleServices'的执行失败。
请通过更新google-services插件的版本来解决版本冲突(有关最新版本的信息,请访问https://bintray.com/android/android-tools/com.google.gms.google-services/)或将com.google.android.gms的版本更新为11.4.2。
这是在我的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.0.2'
implementation 'com.android.support:design:27.0.2'
implementation 'com.google.firebase:firebase-firestore:11.8.0'
implementation 'com.google.firebase:firebase-auth:11.8.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
这是在我的项目级别build.gradle中
buildscript {
ext.kotlin_version = '1.2.10'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:3.1.2'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
同样重要:它在该行下显示一条红线:
implementation 'com.google.firebase:firebase-auth:11.8.0'
如果将鼠标悬停在该消息上,则会收到以下消息:
所有gms / firebase库必须使用完全相同的版本规范(混合版本可能导致运行时崩溃)。找到版本11.8.0、11.4.2。示例包括com.google.android.gms:play-services-auth:11.8.0和com.google.firebase:firebase-analytics:11.4.2
我什至没有分析依赖性!
我该怎么办?
已经尝试过的解决方案:
如果我尝试更改com.google.android.gms
版本,它将使我不满意,说不要将我的整个播放服务捆绑在依赖项中。而且它也不会改变我得到的firebase错误。
将firebase更改为11.4.2将引发皮棉错误。
将Google Play服务版本更改为3.1.1或更低版本将无济于事。
如果我没看错,则Google服务依赖Firebase。我认为两者都有冲突
检查此firebase.google.com/docs/android/setup并调整google服务和firebase依赖版本
另外,请确保在build.gradle (app)
文件底部具有此名称:
apply plugin: 'com.google.gms.google-services'
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句