Android studio 如何在Android Studio中找到google play服务版本?
我正在尝试使用谷歌play服务进行定位。因此,我想在我的应用程序中添加google play服务。在build.gradle依赖项中,我添加了以下行Android studio 如何在Android Studio中找到google play服务版本?,android-studio,google-play-services,build.gradle,Android Studio,Google Play Services,Build.gradle,我正在尝试使用谷歌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 se
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 services。在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管理器中更新google play services存储库
:
在Extras下检查您的SDK管理器,并确保安装了
Google Repository
。- 转到文件->项目结构
- 选择“项目设置”
- 选择“依赖项”选项卡
- 单击“+”并选择“1.Library Dependencies”
- 搜索:
com.google.android.gms:play services
- 选择最新版本并单击“确定”
build.gradle
(app)文件吗好的,我发布了。你试过清理你的项目吗?Build->Clean Project?最佳答案谢谢你的回答,我现在可以添加我已安装的lib,而不必接触gradle文件,谢谢有一些实例需要知道确切的verison编号。就像使用react native geo location service
[在这种情况下,sdk管理器将版本
显示为49
,这是不正确的,我建议您按照pm dubey
的回答来获取所需内容。