如何在Android Studio中找到Google Play服务版本? [英] How to find google play service version in Android Studio?

查看:519
本文介绍了如何在Android Studio中找到Google Play服务版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正试图将Google Play服务用于定位.因此,我想将Google Play服务添加到我的应用中.在build.gradle依赖项中,我添加了以下行.

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'

但是它给出以下错误

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

我找不到安装了哪个版本的Google Play服务.在"SDK工具"标签中,其显示版本为30.

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'

这是整个build.gradle文件.

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'
}

推荐答案

您应在sdk manager中更新Google Play服务存储库:

you should update google play services repository in sdk manager:

这篇关于如何在Android Studio中找到Google Play服务版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆