Ошибка синхронизации уровня приложения, ошибка с сообщением: Не удалось разрешить: com.google.firebase: firebase-core: 15.1.0 - PullRequest
0 голосов
/ 23 мая 2018

Синхронизация для моего 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 Repository иРепозиторий поддержки Android через SDK Manager, который имеет версии 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
}

1 Ответ

0 голосов
/ 23 мая 2018

Не удалось разрешить: com.google.firebase: ядро ​​firebase: 15.1.0

Чтение Firebase Android Release Notes. Вы должнынабор firebase-core:15.0.2

   implementation 'com.google.firebase:firebase-core:15.0.2'
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...