小编use*_*302的帖子

如何在Android Studio中找到Google Play服务版本?

我正在尝试使用Google Play服务进行定位.因此,我想将谷歌播放服务添加到我的应用程序.在build.gradle依赖项中,我添加了以下行.

    compile 'com.google.android.gms:play-services:9.0.1'
Run Code Online (Sandbox Code Playgroud)

但是它会出现以下错误

 Error:(25, 13) Failed to resolve: com.google.android.gms:play-services:9.0.1
Run Code Online (Sandbox Code Playgroud)

我无法找到安装了哪个版本的Google Play服务.在SDK工具选项卡中,它表示版本30.

我也尝试过跟随线,但它也给出了同样的错误

 compile 'com.google.android.gms:play-services:30'
Run Code Online (Sandbox Code Playgroud)

编辑:这是整个build.gradle文件.

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'
}
Run Code Online (Sandbox Code Playgroud)

google-play-services android-studio build.gradle

1
推荐指数
1
解决办法
9222
查看次数