问题描述
我按照设置排行榜。所以在我的游戏项目我已经安装google_play_services lib中,因为它已经使用的AdMob。现在我需要所有的同时BaseGameUtils。但在链接节设置您的游戏项目上述步骤不起作用。让我告诉我做了什么:
- https://github.com/playgameservices/android-basic-samples 和pressed下载ZIP。
- 提取压缩和进口的文件夹到我的项目。 Disselected一切,只选择了
BasicSamples /库/ BaseGameUtils / src目录/主
这是我的项目中加入主
而不是为BaseGameUtils
。 - 右键点击
主
项目,在属性 - >的Android
选定的部分是图书馆
在我的游戏项目在属性 - >的Android
部分添加引用主
图书馆。 (请注意,如果你不选择是库
你不能做6。在库面板中,单击Add按钮。7.选择BaseGameUtils。
一步,因为它指出了教程) - 在我的包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:
Opened https://github.com/playgameservices/android-basic-samples and pressed "Download ZIP" or you can clone the git repo too.
Then there is a
Scripts/make_eclipse_compat
(.cmd for Windows) script.cd android-basic-samples;
and run the script. It generateseclipse_compat
next toScripts
dir.Import into eclipse
android-basic-samples/eclipse_compat/libraries/BaseGameUtils
and not the originalBaseGameUtils
downloaded. Note that in this case in Eclipse you are not getting add theremain
project but a project calledBaseGameUtils
.Right click on
BaseGameUtils
project go toProperties->Android
and make sureIs Library
is checked and addgoogle_play_services
as Reference library.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
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)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!