When I want to install Google play services 15.0.2 (because 15.0.0 create a dexing error I don't know why) I have these errors from 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
But I've never put these dependencies in any build.gradle. If I want to install with the install button, I have the error : Could not find dependency
This is my build.gradle file :
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'
}
EDIT : I succeeded to solve my problem. Actually, I had a multidex script in my parent build.gradle which force updated all my com.gms.google to 15.0.2 but as you said, google play services don't have 15.0.2. I just removed this script and it worked
Firebase libraries now have independent versions, as opposed to the same version they shared before. See here. So this is working for now, but it might be different in the future:
implementation "com.google.firebase:firebase-core:$googlePlayServicesVersion"
implementation "com.google.firebase:firebase-messaging:$googlePlayServicesVersion"
And more importantly, firebase libs no longer have the same version as the google play services ones, there is no version 15.0.2 for play services libraries such as location, see here, the latest is 15.0.0.
My advice is to define each library individually.
To fix you problem change this :
def DEFAULT_GOOGLE_PLAY_SERVICES_VERSION = "15.0.0"
and this:
implementation "com.google.firebase:firebase-core:15.0.2"
implementation "com.google.firebase:firebase-messaging:15.0.2"
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加