Java 创建房间Google Play服务时连接失败

Java 创建房间Google Play服务时连接失败,java,android,google-play-services,google-play-games,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(th

这是我的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());
游戏在哪里停止

@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\u REAL\u TIME\u CONNECTION\u FAILED
,并且
room=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示例进行比较,但没有效果
我已经在平板电脑上安装了Google Play Services 4.0和最新的sdk,只是想让您知道-我发现了我的问题所在。。嗯,有点

在我的例子中,问题出在AdMob上——它最初是作为一个单独的库集成的,当我将GooglePlus添加到游戏中时,开始在控制台中看到很多东西

我很困惑问题出在GooglePlus上(抛出你看到的关于丢失资源的消息),但正是AdMob部分在这么做

尽管如此,即使弄清楚了这一点,Google Plus操作仍然无法正常运行

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!
最奇怪的是,它们在旧的HTC感知(2.2)下工作,但不在任何4.x设备上


我刚刚把整件事都撕碎了-在里面浪费了两天。。对于单个+1按钮。

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

启用多人游戏支持

要集成游戏服务多玩家支持,例如玩家配对,必须启用多玩家设置。目前,仅支持Android实时多人游戏

要启用多人游戏,请执行以下操作:

从Google Play开发者控制台打开Games with Game Services页面,然后选择您的游戏。 打开游戏的链接应用页面,然后将Multitplayer设置切换为ON。 单击“另存为草稿”以存储设置


来源:

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