user3160302
user3160302

Reputation: 237

How to find google play service version in Android Studio?

I am trying to use google play services for location purposes. Therefore I wanted to add google play services to my app. In build.gradle dependincies I added following line.

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

However it gives following error

 Error:(25, 13) Failed to resolve: com.google.android.gms:play-services:9.0.1

I couldnt find which version of Google play services installed. In SDK Tools tab it says version 30.

I've tried following line too but it also gave same error

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

Edit: Here is the whole build.gradle file.

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "ozu.cs394.umurali.whereismycar"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.google.android.gms:play-services:9.0.1'
}

Upvotes: 2

Views: 11418

Answers (3)

pm dubey
pm dubey

Reputation: 1016

  • Go to File -> Project Structure
  • Select 'Project Settings'
  • Select 'Dependencies' Tab
  • Click '+' and select '1.Library Dependencies'
  • Search for : com.google.android.gms:play-services
  • Select the latest version and click 'OK'

Upvotes: 19

hopeman
hopeman

Reputation: 2828

Check your SDK Manager under Extras and make sure that Google Repository is installed.

Upvotes: 0

Mounir Elfassi
Mounir Elfassi

Reputation: 2252

you should update google play services repository in sdk manager:

enter image description here

Upvotes: 2

Related Questions