Когда я хочу установить сервисы 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.Я только что удалил этот скрипт, и он работал