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

问题描述

我按照设置排行榜。所以在我的游戏项目我已经安装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目录下创建这样一个新的类:

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:

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)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-27 12:46