我的应用没有客户端ID?

时间:2015-10-27 10:52:08

标签: android google-play unreal-engine4 unreal-blueprint

所以我正在使用虚幻引擎4制作手机游戏。我目前正在尝试设置Google Play服务,以便我可以进行排行榜,成就和应用内购买,但我现在正在努力解决第一个问题。

您可以在此short video中看到此行为。

似乎它试图联系服务然后出错了它就放弃了。我在手机上发了一个logcat日志文件,这就是我得到的:

I/GamesNativeSDK(16078): Connecting to Google Play...

V/GamesNativeSDK(16078): Attached to JVM on thread main_dispatch

D/ChimeraCfgMgr(11916): Loading module com.google.android.gms.games from APK com.google.android.play.games

D/ChimeraModuleLdr(11916): Module APK com.google.android.play.games already loaded

D/ChimeraCfgMgr(11916): Loading module com.google.android.gms.games from APK com.google.android.play.games

D/ChimeraModuleLdr(11916): Module APK com.google.android.play.games already loaded

V/GamesNativeSDK(16078): Play Games callback indicates connection failure.

I/GamesNativeSDK(16078): UI interaction required to connect to Google Play.

D/UE4     (16078): [2015.10.26-19.31.29:804][  0]LogOnline:Warning: Async task 'Login' failed in 0.582350 seconds

E/SignInIntentService(11916): Access Not Configured. The API (Google Play Game Services API) is not enabled for your project. Please use the Google Developers Console to update your configuration.

E/SignInIntentService(11916): com.google.android.gms.games.server.error.GamesException

E/SignInIntentService(11916):  at com.google.android.gms.games.server.GamesServer.getResponseBlocking(GamesServer.java:164)

E/SignInIntentService(11916):  at com.google.android.gms.games.broker.PlayerAgent.getPlayerFromNetwork(PlayerAgent.java:1700)

E/SignInIntentService(11916):  at com.google.android.gms.games.broker.PlayerAgent.fetchPlayer(PlayerAgent.java:621)

E/SignInIntentService(11916):  at com.google.android.gms.games.broker.DataBroker.loadSelf(DataBroker.java:920)

E/SignInIntentService(11916):  at com.google.android.gms.games.service.PlayGamesSignInIntentService$LoadSelfOperation.executeInternal(PlayGamesSignInIntentService.java:402)

E/SignInIntentService(11916):  at com.google.android.gms.games.service.PlayGamesSignInIntentService$BaseOperation.execute(PlayGamesSignInIntentService.java:51)

E/SignInIntentService(11916):  at com.google.android.gms.games.service.PlayGamesSignInIntentService$OperationAdapter.execute(PlayGamesSignInIntentService.java:487)

E/SignInIntentService(11916):  at com.google.android.gms.chimera.BaseAsyncOperationService$OperationTask.run(BaseAsyncOperationService.java:179)

E/SignInIntentService(11916):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)

E/SignInIntentService(11916):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)

E/SignInIntentService(11916):  at java.lang.Thread.run(Thread.java:818)

E/LoadSelfFragment(16219): Unable to sign in - application does not have a registered client ID

我理解错误消息,但我不明白为什么我会得到它们。我试图直接从启动器部署,并制作一个签名的APK并安装在我的手机上。这是相同的结果。

我四处寻找解决此问题的方法,但我发现我的Developer Console中的设置没有任何问题,也没有找到任何问题。我在这里有点不知所措,我的目标是在2015年12月发布,所以我需要帮助。 Epic Games几乎没有提供节点的文档,所以这一切都让我在黑暗中摸索。

First Part

Second Part

2 个答案:

答案 0 :(得分:2)

经过多次挣扎和在黑暗中摸索,我现在已经找到了解决方案。请关注this link到虚幻论坛查看我是如何做到的!

它的基本要点是:

确保在开发者控制台中解锁以下API:

  • 适用于Android的Google Cloud Messaging
  • Google Cloud Pub / Sub
  • Google Cloud用户帐户
  • Google Play Android Developer API
  • Google Play游戏管理
  • Google Play游戏服务
  • Google+ API

确保您的凭据中有公共服务器密钥,且IP列表中没有IP。

将以下两行添加到项目设置的<manifest>部分。

  • com.google.android.gms.games.APP_ID = “@串/ APP_ID”
  • com.google.android.gms.appstate.APP_ID = “@串/ APP_ID”

然后将所有这些权限添加到项目的Extra Permissions部分

  • com.android.vending.BILLING(仅当您有应用内购买时)
  • android.permission.INTERNET对
  • android.permission.GET_ACCOUNTS
  • android.permission.USE_CREDENTIALS

打开构建文件夹,然后在GooglePlayAppID.xml <PROJECT NAME>\Build\Android\res\values找到您的应用ID

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="app_id">YOUR GAMES APP ID HERE</string>
</resources>

现在,您应该能够使用Epic提供的节点来实现成就,排行榜和应用内购买。

答案 1 :(得分:1)

另一个重要步骤(在虚幻论坛链接中)是对YourProject.build.cs的以下补充:

if (Target.Platform == UnrealTargetPlatform.Android)
{
    PrivateDependencyModuleNames.Add("OnlineSubsystem");
    PrivateDependencyModuleNames.Add("OnlineSubsystemGooglePlay");
}

来源:https://forums.unrealengine.com/showthread.php?67343-How-do-I-debug-refusal-to-connecto-to-Google-Play-services

(其他平台可能需要onlineSubsystem,例如Windows / Steam)