I am trying to include GCM in my app.
I keep getting this error message :
Failed to resolve: com.google.android.gms:play-services-gcm:7.5.+ | Install Repository and sync project | Show in Project Structure dialog
If I try to Install Repository and sync project i get this error:
Loading SDK information... Ignoring unknown package filter 'extra-google-m2repository'Warning: The package filter removed all packages. There is nothing to install. Please consider trying to update again without a package filter.
Here is my gradle file:
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
...
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.google.android.gms:play-services-gcm:7.5.+'
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
classpath 'com.google.gms:google-services:1.3+'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
Could you check that the necessary packages in your Android SDK Manager are up to date.
And use
compile 'com.google.android.gms:play-services-gcm:7.5.0'
I hope it will helps you .
Changing from 7.5.+
to 7.5.0
fixed this issue for me. I'm not sure why the wildcard caused an issue.
I once encountered the same error after updating Android Studio and SDK.
You could try to use 'com.android.tools.build:gradle:1.3.0'
instead of 'com.android.tools.build:gradle:1.2.3'
in Project gradle file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With