Android的游戏无法安装服务排行榜(BaseGameUtils) [英] Android Play Services Leaderboard cannot be installed (BaseGameUtils)

查看:416
本文介绍了Android的游戏无法安装服务排行榜(BaseGameUtils)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照 https://developers.google.com/games/services/android/初始化设置排行榜。所以在我的游戏项目我已经安装google_play_services lib中,因为它已经使用的AdMob。现在我需要所有的同时BaseGameUtils。但在链接节设置您的游戏项目上述步骤不起作用。让我告诉我做了什么:


  1. https://github.com/playgameservices/android-basic-samples 和pressed下载ZIP。

  2. 提取压缩和进口的文件夹到我的项目。 Disselected一切,只选择了 BasicSamples /库/ BaseGameUtils / src目录/主这是我的项目中加入而不是为 BaseGameUtils

  3. 右键点击项目,在属性 - >的Andr​​oid 选定的部分是图书馆在我的游戏项目在属性 - >的Andr​​oid 部分添加引用图书馆。 (请注意,如果你不选择是库你不能做 6。在库面板中,单击Add按钮。7.选择BaseGameUtils。 一步,因为它指出了教程)

  4. 在我的包src目录下创建这样一个新的类:


 进口gms.common.api *。进口com.google.example.games.basegameutils.BaseGameActivity;公共类MyGameActivity扩展BaseGameActivity {


但无论是进口的确认。如何设置呢?这本来是那么容易,但会这样creapy?


解决方案

的步骤是在本教程不完整的。下面是实际的步骤:


  1. 打开<一个href=\"https://github.com/playgameservices/android-basic-samples\">https://github.com/playgameservices/android-basic-samples和pressed下载ZIP或者你可以克隆混帐回购协议了。


  2. 然后有一个脚本/ make_eclipse_compat (.CMD适用于Windows)的脚本。 CD Android的基本采样; 并运行该脚本。它生成 eclipse_compat 旁边的脚本 DIR。


  3. 导入到Eclipse Android的基本采样/ eclipse_compat /库/ BaseGameUtils ,而不是原始的 BaseGameUtils 下载。请注意,在这种情况下,在Eclipse中你没有得到添加有项目,而是一项名为 BaseGameUtils


  4. BaseGameUtils 项目右键单击转到属性 - &GT;的Andr​​oid 并确保是库被选中并添加 google_play_services 作为参考库。


  5. 如果您使用Facebook的例子SDK或其他的SDK,那么你可能有这样的冲突:



  

找到2版本的依赖列表Android的支持 - v4.jar,但
  不是所有的版本是相同的(检查基于SHA-1 ........


下面是分辨率:<一href=\"http://stackoverflow.com/questions/13517222/facebook-sdk-for-android-duplicate-support-library-on-dependencies\">Facebook SDK对Android的依赖重复支持库

<醇开始=6>
  • 同时

    进口gms.common.api。*;


  • 是不对的,你应该这样做:

     进口com.google.android.gms.common.api *。
    进口com.google.example.games.basegameutils.BaseGameActivity;
    公共类MyGameActivity扩展BaseGameActivity {

    I follow https://developers.google.com/games/services/android/init to setup leaderboards. So in my game project I have setup google_play_services lib as it already uses AdMob. Now I need to all Also BaseGameUtils. But the steps in section "Setting up your game project" in the link above don't work. Let me tell what I have done:

    1. Opened https://github.com/playgameservices/android-basic-samples and pressed "Download ZIP".
    2. Extracted the zip and imported the folder into my project. Disselected all and selected only BasicSamples/libraries/BaseGameUtils/src/main which was added in my project as main and not as BaseGameUtils.
    3. Right clicked on main project, in Properties->Android section selected Is Library and in my game project in Properties->Android section added Reference to main library. (Note that if you don't select Is Library you cannot do 6. In the Library panel, click the Add button. 7.Select BaseGameUtils.step as it is pointed out in the tutorial )
    4. In my package src directory create a new class like this:

    import gms.common.api.*;
    
    import com.google.example.games.basegameutils.BaseGameActivity;
    
    public class MyGameActivity extends BaseGameActivity {
    

    but neither of the imports is recognized. How to setup this? This should have been to be so easy but is it so creapy?

    解决方案

    The steps are incomplete in the tutorial. Here are the actual steps:

    1. Opened https://github.com/playgameservices/android-basic-samples and pressed "Download ZIP" or you can clone the git repo too.

    2. Then there is a Scripts/make_eclipse_compat (.cmd for Windows) script. cd android-basic-samples; and run the script. It generates eclipse_compat next to Scripts dir.

    3. Import into eclipse android-basic-samples/eclipse_compat/libraries/BaseGameUtils and not the original BaseGameUtils downloaded. Note that in this case in Eclipse you are not getting add there main project but a project called BaseGameUtils.

    4. Right click on BaseGameUtils project go to Properties->Android and make sure Is Library is checked and add google_play_services as Reference library.

    5. If you use for example Facebook SDK or other SDKs then you may have such a conflict:

    Found 2 versions of android-support-v4.jar in the dependency list, but not all the versions are identical (check is based on SHA-1........

    Here is the resolution: Facebook SDK for Android duplicate support library on dependencies

    1. Also

      import gms.common.api.*;

    is wrong you should do this:

    import com.google.android.gms.common.api.*;
    import com.google.example.games.basegameutils.BaseGameActivity;
    
    
    public class MyGameActivity extends BaseGameActivity {
    

    这篇关于Android的游戏无法安装服务排行榜(BaseGameUtils)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆