【问题标题】:Why i can't get a dependency on the Google Play Services library?为什么我无法依赖 Google Play 服务库?
【发布时间】:2014-11-09 14:48:20
【问题描述】:

我知道它已经被问了数百次,但我真的找不到解决我的问题的方法。

我有这个构建文件:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 20
    buildToolsVersion '20.0.0'

    defaultConfig {
        applicationId "com.gelasoft.gatanki"
        minSdkVersion 14
        targetSdkVersion 20
        versionCode 2
        versionName "1.1"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:20.0.0'
    compile 'com.android.support:support-v4:20.0.0'
    compile 'com.google.android.gms:play-services:0.0.+'
}

你可以看到我正在尝试编译com.google.android.gms:play-services:0.0.+

但是我遇到了一些我真的无法管理的可怕错误。我已经更新了所有内容,但问题仍然存在。

这里的错误是:

当我尝试将项目与 gradle 同步时,它会说:

Error:Failed to find: com.google.android.gms:play-services:0.0.+
<a href="install.m2.repo">Install Repository and sync project</a><br><a href="openFile">Open File</a><br><a href="open.dependency.in.project.structure">Open in Project Structure dialog</a>

在我正在尝试的清单中,它也无法解决:

<meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />

我知道我遗漏了一小部分,但我真的不知道出了什么问题。

你能帮我推一下吗?

【问题讨论】:

    标签: java android gradle android-studio google-play-services


    【解决方案1】:

    据我所知,Play Services SDK 从来没有 0.0.x 版本。试试compile 'com.google.android.gms:play-services:6.1.11'compile 'com.google.android.gms:play-services:6.1.+'

    【讨论】:

      猜你喜欢
      • 2019-05-20
      • 2018-02-15
      • 1970-01-01
      • 1970-01-01
      • 2018-12-23
      • 1970-01-01
      • 1970-01-01
      • 2018-08-08
      • 2014-10-05
      相关资源
      最近更新 更多