在创建空间Google Play服务时CONNECTION_FAILED

时间:2013-11-02 00:59:14

标签: java android google-play-services google-play-games

这是我对quickGame的功能

Bundle autoMatchCriteria = RoomConfig.createAutoMatchCriteria(1, 1, 0);
RoomConfig.Builder rtmConfigBuilder = RoomConfig.builder(this);
rtmConfigBuilder.setMessageReceivedListener(this);
rtmConfigBuilder.setRoomStatusUpdateListener(this);
rtmConfigBuilder.setAutoMatchCriteria(autoMatchCriteria);
switchToScreen(R.id.screen_wait);
//keepScreenOn();
//resetGameVars();
getGamesClient().createRoom(rtmConfigBuilder.build());

和onRoomCreated游戏停止的地方

@Override
    public void onRoomCreated(int statusCode, Room room) {
        Log.d(TAG, "onRoomCreated(" + statusCode + ", " + room + ")");
        if (statusCode != GamesClient.STATUS_OK) {
            Log.e(TAG, "*** Error: onRoomCreated, status " + statusCode);
            showGameError();
            return;
        }
        showWaitingRoom(room);
    }

我得到statusCode = 7000 STATUS_REAL_TIME_CONNECTION_FAILEDroom = null所以我认为问题出在quickGame函数中。

D/Multiplayer(24221): Sign-in succeeded.
D/Multiplayer(24221): GameHelper: onActivityResult: req=10001, resp=RESULT_CANCELED
D/Multiplayer(24221): GameHelper: onActivityResult: request code not meant for us. Ignoring.
W/Multiplayer(24221): *** invitation inbox UI cancelled, 0
D/Multiplayer(24221): GameHelper: onActivityResult: req=10000, resp=RESULT_OK
D/Multiplayer(24221): GameHelper: onActivityResult: request code not meant for us. Ignoring.
D/Multiplayer(24221): Select players UI succeeded.
D/Multiplayer(24221): Invitee count: 1
D/Multiplayer(24221): Creating room...
D/Multiplayer(24221): Room created, waiting for it to be ready...
D/Multiplayer(24221): onRoomCreated(7000, null)
E/Multiplayer(24221): *** Error: onRoomCreated, status 7000
W/ResourceType(24221): getEntry failing because entryIndex 13 is beyond type entryCount 1
W/ResourceType(24221): Failure getting entry for 0x7f0b000d (t=10 e=13) in package 0 (error -2147483647)
E/GooglePlayServicesUtil(24221): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
W/PicturePileLayerContent(24221): Warning: painting PicturePile without content!
W/PicturePileLayerContent(24221): Warning: painting PicturePile without content!
W/PicturePileLayerContent(24221): Warning: painting PicturePile without content!

我将源代码与google示例进行比较,但没有效果 我在平板电脑和最新的sdk上使用Google Play Services 4.0

3 个答案:

答案 0 :(得分:1)

您是否在Google Play开发者控制台中启用了多人游戏?

  

启用多人游戏支持

     

要整合游戏服务多人游戏支持,例如玩家匹配,您必须启用多人游戏设置。目前,仅支持Android的实时多人游戏。

     

启用多人游戏:

     

从Google Play开发者控制台打开带游戏服务的游戏页面,然后选择您的游戏。   打开游戏的链接应用页面,然后将多人游戏设置切换为开启。   单击另存为草稿以存储您的设置。

来源:https://developers.google.com/games/services/console/configuring#enabling_multiplayer_support

答案 1 :(得分:0)

只是为了让你知道 - 我弄明白我的问题是什么......好吧..

事实证明问题是AdMob在我的情况下 - 它最初是作为一个单独的库集成的,当我将GooglePlus添加到游戏中时开始在控制台中看到很多东西。

我很困惑,问题是GooglePlus(抛出你看到的有关缺少资源的消息) - 但正是AdMob部分正在这样做。

尽管如此,即使考虑到这一点,GooglePlus操作也无法正常运行。

最奇怪的是,它们在旧的HTC Sense(2.2)下工作,但在任何4.x设备上都没有。

我刚把整个东西撕掉了 - 在它里面丢了两天......一个+1按钮。

答案 2 :(得分:0)

我从互联网上安装了google play services.apk,这就是原因。我等待Google Play的更新,现在一切正常:)