Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not resolve com.google.gms:google-services:3.0.0

I read many posts on this topic, but no one helped me. I'm using Android Studio and following this guide

This is the project gradle:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'
        classpath 'com.google.gms:google-services:3.0.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

this is the app gradle:

apply plugin: 'com.android.application'

    android {
        compileSdkVersion 25
        buildToolsVersion "25.0.1"
        defaultConfig {
            applicationId "com.xyv.appname"
            minSdkVersion 15
            targetSdkVersion 25
            versionCode 1
            versionName "1.0"
            testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    }

    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
            exclude group: 'com.android.support', module: 'support-annotations'
        })
        compile 'com.android.support:appcompat-v7:25.0.1'
        compile 'com.android.support:design:25.0.1'
        testCompile 'junit:junit:4.12'
        compile 'com.google.firebase:firebase-core:10.0.1'        
    }
    apply plugin: 'com.google.gms.google-services'

Here you can see where I added google-services.json inside my app:

enter image description here

These are my SDK tools:

enter image description here

Does anybody understand what's my error?

Thank you in advance

like image 960
MDP Avatar asked Dec 13 '16 15:12

MDP


1 Answers

You may need to add

compile 'com.google.android.gms:play-services:9.6.1'

in your app build.gradle also. ref: Upgrade to Google Play Services:9.0.0 Error Failed to resolve: com.google.android.gms:play-services-measurement:9.0.0

If you recently bumped the version to 3.0.0 you should doublecheck that you have installed the correct version on your machine in the Android SDK manager.

like image 172
sschrass Avatar answered Sep 25 '22 02:09

sschrass