【发布时间】:2016-09-29 10:24:18
【问题描述】:
我正在尝试使用 google play 服务进行定位。因此,我想将 google play 服务添加到我的应用程序中。在 build.gradle 依赖项中,我添加了以下行。
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。
我也尝试过以下行,但它也给出了同样的错误
compile 'com.google.android.gms:play-services:30'
编辑:这是整个 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'
}
【问题讨论】:
-
你有哪个版本的SDK工具?
-
我有 SDK 工具 25.1.6
-
你能把你的
build.gradle(app)文件发一下吗 -
好的,我贴出来了。
-
您是否尝试过清理您的项目?构建 -> 清理项目?
标签: android-studio google-play-services build.gradle