通过更新google-services插件的版本或将com.google.android.gms的版本更新为11.8.0来修复版本冲突[重复]

问题描述 投票:0回答:1

这个问题在这里已有答案:

我正在使用Firebase开发Android应用,然后使用此tutorial安装Admin SDK。在我的应用程序中的build.gradle文件中,自从我在项目早期添加它们之后,我有一些依赖项给了我警告,但我仍然可以运行该应用程序。一旦我添加了Admin SDK所需的依赖项,事情变得更加严重......

这些是原始依赖项及其警告:

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

所有gms / firebase库必须是完全相同的版本规范。发现版本9.6.0,1.11.0

implementation 'com.android.support:appcompat-v7:26.1.0'

所有com.android.support库必须是完全相同的版本规范。找到的版本26.1.0,23.4.0

我使用Android Studio中的双移搜索功能搜索整个项目,但找不到任何使用过任何一个冲突版本(9.6.0或23.4.0)的内容。

就像我说的,应用程序仍然运行,所以我继续开发。在添加Firebase Admin SDK时,我向build.gradle添加了以下依赖项:

implementation 'com.google.firebase:firebase-admin:5.6.0'

当我在我的gradle上点击'sync'时,我收到以下错误:

错误:任务':app:processDebugGoogleServices'的执行失败。请通过更新google-services插件的版本(https://bintray.com/android/android-tools/com.google.gms.google-services/上提供有关最新版本的信息)或将com.google.android.gms的版本更新为11.8.0来修复版本冲突。

这让我有点困惑,因为我认为最新版本的com.google.firebase:firebase-admin是5.6.0,所以我不知道如何使用它来获得版本冲突。

当这个错误存在时我的应用程序将无法运行,因此任何帮助过去都会非常感激。我是Android开发的新手,所以很可能是我错过的非常明显的东西。

这是我的完整依赖列表:

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0' <-- warning
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.firebase:firebase-core:11.8.0' <-- warning
implementation 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.firebaseui:firebase-ui:0.6.0'
implementation 'com.firebaseui:firebase-ui-auth:3.1.0'
implementation 'com.google.android.gms:play-services-auth:11.8.0'
implementation 'com.google.android.gms:play-services-location:11.8.0'
implementation 'com.google.firebase:firebase-core:11.8.0'
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.google.firebase:firebase-admin:5.6.0' <-- introduced error
implementation 'com.google.firebase:firebase-messaging:11.8.0'
}

如果我可以包含任何有助于诊断的内容,请告诉我们!

提前致谢,

标记

android firebase
1个回答
0
投票

Firebase管理SDK适用于JVM服务器,不能与客户端SDK一起使用。有关详细信息,请参阅此great post。我建议使用Cloud Functions作为管理员的东西,因为他们是你控制的东西,不能在客户端上妥协。

© www.soinside.com 2019 - 2024. All rights reserved.