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

查看:31
本文介绍了如何在 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 services repository:

you should update google play services repository in sdk manager:

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

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