8

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

MDP
  • 4,177
  • 21
  • 63
  • 119

3 Answers3

1

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.

Community
  • 1
  • 1
sschrass
  • 7,014
  • 6
  • 43
  • 62
  • I added a print screen of my SDK tools; as you can see I have Google Play Services version 38 – MDP Dec 13 '16 at 15:28
0

Open the stand alone SDK Manager, in the Extras section the you will find "Google Play Services" update it .

enter image description here

Mithun Sarker Shuvro
  • 3,902
  • 6
  • 32
  • 64
  • 1
    Thanks for you help, but Google Play Services version 38 is already installed – MDP Dec 13 '16 at 15:25
0

I resolve my issue by updating android studio to 2.3 beta 2 I did just update an android studio and all is ruining well