Как сохранить разные версии Firebase? - PullRequest
0 голосов
/ 26 июня 2019

Мне нужно использовать другой набор библиотек firebase в проекте. Но я получаю следующую ошибку:

Unable to resolve dependency for ':@debug/compileClasspath': Could not resolve com.android.support:support-v13:28.0.0.
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.google.android.gms:play-services-auth:17.0.0'
implementation 'com.google.android.gms:play-services-plus:17.0.0'
implementation 'com.google.firebase:firebase-core:17.0.0'
implementation 'com.google.firebase:firebase-auth:18.0.0'
implementation 'com.google.firebase:firebase-messaging:19.0.0'
// Add dependency
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
implementation 'com.google.firebase:firebase-iid:19.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.facebook.android:facebook-android-sdk:4.34.0'
implementation 'com.google.firebase:firebase-crash:16.2.1'

1 Ответ

2 голосов
/ 26 июня 2019

Если вы хотите использовать последние версии, то вы можете использовать firebase BoM, в поле build.gradle напишите следующее:

dependencies {
  // Import the platform
  implementation platform('com.google.firebase:firebase-bom:20.0.1')

  // When using a BoM, dependencies don't require a specified version
  // If you do specify a version, it overrides the library version specified in the BoM
  implementation 'com.google.firebase:firebase-core'
  implementation 'com.google.firebase:firebase-auth'
  implementation 'com.google.firebase:firebase-firestore'
}

com.google.firebase:firebase-bom:20.0.1 будет содержать последнюю версию всехбиблиотеки Firebase, затем для использования каждой конкретной библиотеки вы добавляете их как обычно, но без версии.

Ссылки:

https://firebase.google.com/docs/android/setup#firebase-bom

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...