gpt4 book ai didi

android - Android Studio构建Gradle同步失败

转载 作者:行者123 更新时间:2023-12-03 05:01:33 25 4
gpt4 key购买 nike

我正在尝试将Google Play服务添加到我的项目中,但是当我尝试编辑版本(Gradle)时却给我错误。

enter image description here

我该如何解决?

最佳答案

在您的配置中存在一些问题。

  • 您使用的错误的 build.gradle文件。
    这是您的顶级文件。
    您应该在app/build.gradle
  • 中添加此行
  • 有一个错字。您在编译行的末尾缺少'
  • 使用的更新版本

  • 例如使用:
    apply plugin: 'com.android.application'
    ...

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

    最后,请引用 official doc以获取更多信息。

    In versions of Google Play services prior to 6.5, you had to compile the entire package of APIs into your app. In some cases, doing so made it more difficult to keep the number of methods in your app (including framework APIs, library methods, and your own code) under the 65,536 limit.

    For example if you need to make only your app aware of location updates add compile 'com.google.android.gms:play-services-location:8.1.0' only in gradle or if you need only map choose compile 'com.google.android.gms:play-services-maps:8.1.0'.

    关于android - Android Studio构建Gradle同步失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33515260/

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