Fab*_*ues 3 import android google-play-services
我正在尝试使用Google Play游戏服务开发实时多人游戏,我下载了示例(ButtonClicker2000),但Eclipse ADK一直在抱怨com.google.android.gms.games.GamesClient无法解析.
所有其他进口工作正常:
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;
Run Code Online (Sandbox Code Playgroud)
有谁知道如何解决这一问题?
ılǝ*_*ılǝ 26
GamesClient是Google Play服务库的一部分 - google-play-services.jar.
在旧版本中,如果您浏览库,则可以找到该类.在Eclipse中,它可能位于包列表中的"Android Private Libraries"下.下去打包并搜索com.google.android.gms.games.GamesClient
由于Google Play服务更新至4.3版,因此不再提供GamesClient.您应该切换到GoogleApiClient.
因此,如果您从Android SDK Manager更新您的软件包,Google Play服务将更新为2014年3月17日发布的第16版.由于GamesClient已弃用,因此在重新启动Eclipse并刷新工作区后,软件包中将缺少该软件包.
以前的游戏客户端已于2014年2月7日弃用.强烈建议现有和新开发者使用GoogleApiClient而不是弃用的GamesClient:
因此,您需要使用GoogleApiClient(更好)替换GamesClient,或者将您的google-play-service lib降级到旧版本(不推荐).
要替换GamesClient,您需要重构代码.以下是新API的官方公告和介绍.以下是更新样本的一个示例.
playgameservices示例可能会更新,您可以为该项目的github页面发出票证.
| 归档时间: |
|
| 查看次数: |
7205 次 |
| 最近记录: |