Синхронизация Gradle уровня моего приложения не удалась после того, как я добавил следующие строки в файл build.gradle
implementation 'com.google.firebase:firebase-auth:15.1.0'
implementation 'com.google.android.gms:play-services-auth:15.0.1'
Обновлено: добавление следующей строки устранит проблему
implementation 'com.google.firebase:firebase-core:15.0.2'
Он возвращает следующую ошибку:
Failed to resolve: com.google.firebase:firebase-core:15.1.0
Я проверил свои сервисы Google Play, репозиторий Google и репозиторий поддержки Android через диспетчер SDK, который имеет версии 49, 58 и 47.0.0 соответственно, которые все обновлены.
Я также пробовал добавить
implementation 'com.google.firebase:firebase-core:15.1.0'
но по-прежнему вызывает ту же ошибку.
Вот некоторые из моих кодов:
build.gradle (приложение)
apply plugin: 'com.android.application'
android {
useLibrary 'org.apache.http.legacy' //to be able to use HttpClient class
compileSdkVersion 26
defaultConfig {
applicationId "ph.edu.uplb.ics.opruplb"
minSdkVersion 19
targetSdkVersion 26
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 'com.google.firebase:firebase-core:15.1.0'
implementation 'com.google.firebase:firebase-auth:15.1.0'
implementation 'com.google.android.gms:play-services-auth:15.0.1'
implementation 'com.google.firebase:firebase-database:15.0.1'
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:26.1.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'
}
apply plugin: 'com.google.gms.google-services'
build.gradle (Проект)
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.google.gms:google-services:4.0.0'
}
}
allprojects {
repositories {
maven {
url "https://maven.google.com" // Google's Maven repository
}
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Сейчас он работает, спасибо!
Failed to resolve: com.google.firebase:firebase-core:15.1.0
Прочтите Firebase Android Release Notes. Вы должны установить firebase-core:15.0.2
implementation 'com.google.firebase:firebase-core:15.0.2'
Извините, я упустил это из виду. Но теперь он работает, спасибо!
@IntelliJAmiya Переход на более раннюю версию пути к классам google gms не рекомендуется, Google рекомендует всегда использовать последнюю версию: bintray.com/android/android-tools/…
Посмотрите на firebase.google.com/support/release-notes/android последнюю версию