Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to resolve: com.google.android.gms:play-services-gcm:7.5.+

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()
    }
}
like image 562
Thiago Avatar asked Aug 27 '15 03:08

Thiago


3 Answers

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 .

like image 63
IntelliJ Amiya Avatar answered Nov 04 '22 04:11

IntelliJ Amiya


Changing from 7.5.+ to 7.5.0 fixed this issue for me. I'm not sure why the wildcard caused an issue.

like image 6
theblang Avatar answered Nov 04 '22 05:11

theblang


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.

like image 1
Roman Dezhin Avatar answered Nov 04 '22 05:11

Roman Dezhin