com.google.android.gms.games.GamesClient不能得到解决 [英] com.google.android.gms.games.GamesClient cannot be resolved

查看:312
本文介绍了com.google.android.gms.games.GamesClient不能得到解决的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I'm尝试开发使用谷歌玩游戏服务的实时多人游戏,我下载的样本(ButtonClicker2000),但是Eclipse ADK不断抱怨com.google.android.gms.games.GamesClient无法得到解决。

I´m trying to develop a real-time multiplayer game using google play game services and I download the sample(ButtonClicker2000), but Eclipse ADK keeps complaining that com.google.android.gms.games.GamesClient cannot be resolved.

所有其他进口的正常工作:

All of the other imports work fine:

import com.google.android.gms.games.Games;
import com.google.android.gms.games.GamesActivityResultCodes;
import com.google.android.gms.games.multiplayer.Invitation;
import com.google.android.gms.games.multiplayer.OnInvitationReceivedListener;
import com.google.android.gms.games.multiplayer.Participant;
import com.google.android.gms.games.multiplayer.realtime.RealTimeMessage;
import com.google.android.gms.games.multiplayer.realtime.RealTimeMessageReceivedListener;
import com.google.android.gms.games.multiplayer.realtime.Room;
import com.google.android.gms.games.multiplayer.realtime.RoomConfig;
import com.google.android.gms.games.multiplayer.realtime.RoomStatusUpdateListener;
import com.google.android.gms.games.multiplayer.realtime.RoomUpdateListener;
import com.google.example.games.basegameutils.BaseGameActivity;

有谁知道如何解决这个问题?

Does anyone know how to fix this?

推荐答案

GamesClient是谷歌播放服务库的一部分 - 谷歌播放services.jar

GamesClient was a part of the Google Play Services library - google-play-services.jar.

在旧版本中,你可以找到类,如果你探索的图书馆。在Eclipse在你的软件包列表可能是在Android的私人图书馆。走下来的包和搜索 com.google.android.gms.games.GamesClient

In older versions, you could locate the class if you explore the library. In Eclipse it's probably under 'Android Private Libraries' in your package list. Go down the packages and search for com.google.android.gms.games.GamesClient

自从谷歌Play业务更新至4.3版,GamesClient不再可用。您应该切换到GoogleApiClient代替。

因此​​,如果您更新了Android SDK中管理你的包,谷歌播放服务将被更新到版本16日发布3月17日2014年对自 GamesClient 已去precated,将丢失的形式包你重新启动Eclipse并刷新工作空间之后。

So if you update your packages from the Android SDK Manager, Google Play Services will be updated to revision 16, released on 17 March 2014. Since GamesClient has been deprecated, it will be missing form the package after you restart Eclipse and refresh the workspace.

这是官方的说法

在previous游戏客户端pcated为2014年2月7日的日$ P $。   现有的和新的开发者应当使用   GoogleApiClient代替pcated GamesClient去$ P $:

The previous Games client is deprecated as of February 7th, 2014. Existing and new developers are strongly encouraged to use GoogleApiClient instead of the deprecated GamesClient.:

所以,你要么需要与GoogleApiClient(更好)替换GamesClient,或降级您的谷歌播放服务的lib到旧版本(不推荐)。

So you either need to replace GamesClient with GoogleApiClient (better), or downgrade your google-play-service lib to the older version (not recommended).

为了取代GamesClient,则需要重构code。下面是官方<一href="http://android-developers.blogspot.jp/2014/02/new-client-api-model-in-google-play.html">announcement并介绍了新的API 。 <一href="https://github.com/playgameservices/android-samples/commit/c2e6a2d66abaece3404f6a7b0e36e634470aca5d">Here是更新的样本的的一个例子。

In order to replace GamesClient, you will need to refactor the code. Here is the official announcement and introduction to the new API. Here is one example of an updated sample.

这很可能是playgameservices样品将被更新,你可以发出车票的项目的GitHub的页面的。

It's likely that the playgameservices samples will be updated, you can issue a ticket the github page of the project for that.

这篇关于com.google.android.gms.games.GamesClient不能得到解决的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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