【问题标题】:Can't add GooglePlayServices to libGDX project on IntelliJIdea with google Repository already installed and the correct Android SDK path无法在 IntelliJIdea 上的 libGDX 项目中添加 GooglePlayServices 已安装 google Repository 和正确的 Android SDK 路径
【发布时间】:2014-10-05 15:48:24
【问题描述】:

我正在尝试将 Google 游戏功能添加到我正在开发的视频游戏中。我在 IntelliJ Idea 上使用 LibGDX。我正在使用的 LibGDX 版本(1.2.0)使用基于 gradle 的项目。

我已将此添加到主 build.gradle 文件的 project(":android") 块的依赖项部分:

compile 'com.google.android.gms:play-services:5.2.8'

但是,IntelliJ Idea 在构建时给了我这个错误:

Error:Gradle: A problem occurred configuring project ':android'.
> Could not resolve all dependencies for configuration ':android:_debugCompile'.
   > Could not find com.google.android.gms:play-services:5.2.8.
     Required by:
         cg.euler:android:1.0

另外,“编译”行给了我这个警告:

Dependency on Play Services, but the SDK installation does not have the "Extras > Google Repository" installed. Open the SDK manager and install it.

这是我检查/测试过的:

  • 项目上Android SDK路径配置正确(我的电脑只有一个SDK)
  • Google Repository 软件包已安装在 SDK 管理器上
  • Google Play 服务包已安装在 SDK 管理器上
  • 我尝试在 SDK 管理器上重新安装 Google Repository 和 Google Play 库

【问题讨论】:

    标签: android intellij-idea gradle libgdx google-play-services


    【解决方案1】:

    你play-services依赖版本不对,应该是

    compile 'com.google.android.gms:play-services:5.2.08'
    

    【讨论】:

    • 哈哈哈.....哇......真是个菜鸟错误:P。谢谢,原来如此,谢谢。
    猜你喜欢
    • 2016-10-28
    • 1970-01-01
    • 1970-01-01
    • 2018-01-28
    • 2014-09-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多