gpt4 book ai didi

android - 错误 :(23, 13) 无法解析 : com. google.android.gms :play-services:11. 2.0 "Install Repository and sync project"不起作用

转载 作者:塔克拉玛干 更新时间:2023-11-02 07:53:49 25 4
gpt4 key购买 nike

我正在尝试在我的 Android 应用程序中获取位置并更新到服务器。这是我的 Gradle 代码,这里我包含了 compile 'com.google.android.gms:play-services:11.2.0'。这一行是from the documentation :

dependencies {
compile 'com.google.android.gms:play-services:11.2.0'

compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-v4:25.3.1'
}

但这是我得到的错误:

Error:(23, 13) Failed to resolve: com.google.android.gms:play-services:11.2.0
Install Repository and sync project
Show in File
Show in Project Structure dialog

单击“安装存储库和同步项目”不起作用。

最佳答案

将此添加到您的项目级 build.gradle 文件中:

repositories {
maven {
url "https://maven.google.com"
}
}

关于android - 错误 :(23, 13) 无法解析 : com. google.android.gms :play-services:11. 2.0 "Install Repository and sync project"不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45688654/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com