Следуя помощнику Firebase (AndroidStudio: Инструмент> Firebase), я попытался добавить Firebase AUthentication в свое приложение.Но после настройки зависимостей синхронизация проекта Gradle завершилась с ошибкой, как показано ниже.Я изо всех сил пытаюсь решить эту проблему ... Кто-нибудь может мне помочь?
В проекте "приложение" разрешенная зависимость библиотеки сервисов Google Play зависит от другого в конкретной версии (например, "[15.0. 1] ", но не разрешается до этой версии. Поведение, демонстрируемое библиотекой, будет неизвестно. Сбой зависимости: com.google.android.gms: play-services-flags: 15.0.1 -> com.google.android.gms: play-services-basement @ [15.0.1], но версия play-services-basement была 16.0.1. Следующие зависимости являются проектными зависимостями, которые являются прямыми или имеют транзитивные зависимости, которые приводят к искусственному решению проблемы.- «Приложение» проекта зависит от com.google.firebase: firebase-firestore@17.1.4 - «Приложение» проекта зависит от com.google.firebase: firebase-database@16.0.5 - «Приложение» проекта зависит от ком.google.firebase: firebase-auth@16.0.1 - «Приложение» проекта зависит от com.firebaseui: firebase-ui-auth@4.1.0 Для расширенной информации об отладке выполните Gradle из командной строки с помощью ./gradlew --info: приложение: АССАМБЛЕЯleDebug, чтобы увидеть пути зависимости от артефакта.Это сообщение об ошибке поступило от подключаемого модуля google-services Gradle, сообщает о проблемах по адресу https: // github.com/google/play-services-plugins и отключает его, добавив googleServices {disableVersionCheck = false} в файл b uild.gradle.
Buid.gradle (Проект)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
// Define versions in a single place
ext {
roomVersion = '1.1.1'
archLifecycleVersion = '1.1.1'
supportLibraryVersion = '26.1.0'
}
Biud.gradle (Модуль)
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.poc.android.myhospitals"
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:27.1.1'
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.android.support:recyclerview-v7:27.1.1'
implementation "com.android.support:support-v4:$rootProject.supportLibraryVersion"
// Firebase
implementation 'com.google.firebase:firebase-firestore:17.1.4'
implementation 'com.google.firebase:firebase-database:16.0.5'
implementation 'com.google.firebase:firebase-auth:16.0.1:15.0.0'
implementation 'com.firebaseui:firebase-ui-auth:4.1.0'
// Room components
implementation "android.arch.persistence.room:runtime:$rootProject.roomVersion"
annotationProcessor "android.arch.persistence.room:compiler:$rootProject.roomVersion"
// Lifecycle components
implementation "android.arch.lifecycle:extensions:$rootProject.archLifecycleVersion"
annotationProcessor "android.arch.lifecycle:compiler:$rootProject.archLifecycleVersion"
implementation "android.arch.lifecycle:viewmodel:1.1.1"
implementation 'com.jakewharton.timber:timber:4.7.1'
}