ядро firebase: 12.0.1 не найдено - PullRequest
0 голосов
/ 24 мая 2018

Я создал проект Firebase, и он говорит, что я должен изменить версию ядра до 12 в соответствии с рисунком

enter image description here

Код по умолчанию:9.6.1.Итак, я изменил это число на 12.0.1

compile 'com.google.firebase:firebase-core:12.0.1'

Однако синхронизация не удалась со следующей ошибкой

Failed to resolve: com.google.firebase:firebase-core:12.0.1

Что мне делать?

Ответы [ 4 ]

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

Во избежание дальнейших ошибок в grandle, из-за ошибки попробуйте использовать:

classpath 'com.google.gms:google-services:3.2.1'

А для Firebase используйте то, что вам нужно снизу:

    implementation 'com.google.firebase:firebase-core:15.0.2'
    implementation 'com.google.firebase:firebase-ads:15.0.1'
    implementation 'com.google.firebase:firebase-analytics:15.0.2'
    implementation 'com.google.firebase:firebase-appindexing:15.0.1'
    implementation 'com.google.firebase:firebase-auth:15.1.0'
    implementation 'com.google.firebase:firebase-firestore:16.0.0'
    implementation 'com.google.firebase:firebase-functions:15.0.0'
    implementation 'com.google.firebase:firebase-messaging:15.0.2'
    implementation 'com.google.firebase:firebase-storage:15.0.2'
    implementation 'com.google.firebase:firebase-crash:15.0.2'
    implementation 'com.google.firebase:firebase-invites:15.0.1'
    implementation 'com.google.firebase:firebase-perf:15.2.0'
    implementation 'com.google.firebase:firebase-database:15.0.1'
    implementation 'com.google.firebase:firebase-config:15.0.2'
  • Если вы используете игровые сервисы Gogle в версии для вашего grandle, установите версию 15.0.0, как показано ниже:

    implementation 'com.google.android.gms:play-services-location:15.0.0'
    implementation 'com.google.android.gms:play-services-maps:15.0.0'
    implementation 'com.google.android.gms:play-services-places:15.0.0'
    implementation 'com.google.android.gms:play-services-gcm:15.0.0'
    

Надеюсь, это поможет вам =)

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

Вам нужно добавить google() maven внутри вашего allProjects блока в вашем проекте build.gradle, например:

buildscript {
    repositories {
        jcenter()
        mavenCentral()
    }
    dependencies {
        ...
    }
}

repositories {
    ...
}

// You need to add the google maven in this block.
allprojects {
    repositories {
        jcenter()
        google()
    }
}
0 голосов
/ 24 мая 2018

com.google.firebase:firebase-core:12.0.1 уже старая версия.

Вы можете попробовать версию 15.0.0 или как Леви Альбукерке сказал 16.0.0

Однако просто чтобы напомнить вам, чтоесли вы реализуете несколько библиотек одного и того же типа, они всегда должны быть в одной и той же версии, чтобы избежать ошибок синхронизации.

Пример

implementation 'com.google.firebase:firebase-auth:15.0.0'
implementation 'com.google.firebase:firebase-storage:15.0.0'
implementation 'com.google.firebase:firebase-database:15.0.0' 

Все одинаковыеверсия 15.0.0

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

Обновите плагин gms:

classpath 'com.google.gms:google-services:4.0.0' // google-services plugin

и библиотеку firebase:

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

Также добавьте google maven в файл build.gradle:

allprojects {
    // ...
    repositories {
        // ...
        maven {
        url "https://maven.google.com" // Google's Maven repository
       }
        jcenter()
        maven { url "https://jitpack.io" }
    }
}
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...