Не удается разрешить службы Google Play версии 15.0.2 - PullRequest
0 голосов
/ 10 мая 2018

Когда я хочу установить сервисы Google Play 15.0.2 (потому что 15.0.0 создают ошибку дексинга, я не знаю почему) У меня есть эти ошибки из gradle:

Failed to resolve: com.google.android.gms:play-services-location:15.0.2
Install Repository and sync project
Open File
Show in Project Structure dialog


Failed to resolve: com.google.android.gms:play-services-basement:15.0.2
Install Repository and sync project
Open File
Show in Project Structure dialog


Failed to resolve: com.google.android.gms:play-services-tasks:15.0.2
Install Repository and sync project
Open File
Show in Project Structure dialog

Но яникогда не помещайте эти зависимости в любой build.gradle.Если я хочу установить с помощью кнопки установки, у меня появляется ошибка: не удалось найти зависимость

Это мой файл build.gradle:

apply plugin: 'com.android.library'

def DEFAULT_COMPILE_SDK_VERSION             = 25
def DEFAULT_BUILD_TOOLS_VERSION             = "25.0.2"
def DEFAULT_TARGET_SDK_VERSION              = 25
def DEFAULT_GOOGLE_PLAY_SERVICES_VERSION    = "15.0.2"

android {
compileSdkVersion project.hasProperty('compileSdkVersion') ? 
project.compileSdkVersion : DEFAULT_COMPILE_SDK_VERSION
buildToolsVersion project.hasProperty('buildToolsVersion') ? 
project.buildToolsVersion : DEFAULT_BUILD_TOOLS_VERSION

defaultConfig {
    minSdkVersion 16
    targetSdkVersion 
project.hasProperty('buildToolsVetargetSdkVersionrsion') ? 
project.buildToolsVersion : DEFAULT_TARGET_SDK_VERSION
    versionCode 1
    versionName "1.0"
}
}

repositories {
mavenCentral()
}

dependencies {
    def googlePlayServicesVersion = 
project.hasProperty('googlePlayServicesVersion') ? 
project.googlePlayServicesVersion : DEFAULT_GOOGLE_PLAY_SERVICES_VERSION

    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.facebook.react:react-native:+'
    compile "com.google.firebase:firebase-core:$googlePlayServicesVersion"
    compile "com.google.firebase:firebase-messaging:$googlePlayServicesVersion"
    compile 'me.leolin:ShortcutBadger:1.1.17@aar'
}

РЕДАКТИРОВАТЬ: мне удалось решить мою проблему,На самом деле у меня в родительском build.gradle был скрипт multidex, который принудительно обновил все мои com.gms.google до 15.0.2, но, как вы сказали, сервисы Google Play не имеют 15.0.2.Я только что удалил этот скрипт, и он работал

1 Ответ

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

Библиотеки Firebase теперь имеют независимые версии, в отличие от той же версии, которую они использовали ранее.Смотрите здесь .Так что пока это работает, но в будущем это может измениться:

implementation "com.google.firebase:firebase-core:$googlePlayServicesVersion"
implementation "com.google.firebase:firebase-messaging:$googlePlayServicesVersion"

И, что более важно, библиотеки Firebase больше не имеют той же версии, что и у сервисов Google Play, версии 15.0 нет.2 для библиотек служб воспроизведения, таких как местоположение, см. здесь , последняя версия - 15.0.0.

Мой совет - определить каждую библиотеку индивидуально.

Чтобы устранить проблемуизмените это:

def DEFAULT_GOOGLE_PLAY_SERVICES_VERSION    = "15.0.0"

и это:

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