Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/187.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 在将Google Play服务添加到我的libgdx android项目中时面临严重问题_Java_Android_Eclipse_Libgdx - Fatal编程技术网

Java 在将Google Play服务添加到我的libgdx android项目中时面临严重问题

Java 在将Google Play服务添加到我的libgdx android项目中时面临严重问题,java,android,eclipse,libgdx,Java,Android,Eclipse,Libgdx,我对android游戏开发非常陌生,我想将Google Play Services库添加到我的项目中。我下载了Google Play Services rev 25,将其复制到我的sdk>extras>Google,并将Google Play Services库导入到我的项目中。我还通过选中该框将其复制到我的工作空间。我还通过查看导入项目的属性来检查该库是否实际上是一个库。然后,我去我的android项目>属性>android>添加添加google play服务库,但它不在那里,项目选择窗口看起

我对android游戏开发非常陌生,我想将Google Play Services库添加到我的项目中。我下载了Google Play Services rev 25,将其复制到我的sdk>extras>Google,并将Google Play Services库导入到我的项目中。我还通过选中该框将其复制到我的工作空间。我还通过查看导入项目的属性来检查该库是否实际上是一个库。然后,我去我的android项目>属性>android>添加添加google play服务库,但它不在那里,项目选择窗口看起来被禁用了。我清理、重新启动并重新安装了eclipse和google play服务好几次,但都没有任何效果

我附上我的项目的一些照片。请给我建议,这样我就可以继续我的第一个项目了


[My Android Project Manifest][3][Google Play Services API 25 Manifest][4]

最后,在与eclipse斗争了将近一天之后,我发现eclipse使用的是独立的JRE,而不是JRE附带的JDK。因此,我将JDK添加到我的eclipse项目中,然后进入windows>preferences>gradle>arguments>并将工作区JRE设置为新添加的JDK

我不知道这是否是真正的解决方案,但我能够添加谷歌播放服务到我的项目后,这样做

希望能有帮助

  • 转到文件
    {PROJECT\u FOLDER}/build.gradle
    ,并添加以下类路径:
  • 
    构建脚本{
    ....
    依赖关系{
    ....
    classpath'com.google.gms:googleservices:3.0.0'
    }
    }
    

  • 转到文件
    {PROJECT_FOLDER}/android/build.gradle
    ,添加以下依赖项/插件:
  • 
    依赖关系{
    ...
    编译'com.google.android.gms:play services gcm:10.2.0'
    }
    应用插件:“com.google.gms.googleservices”
    

    还请记住在SDK管理器中安装Google Repository。

    可能重复的