【问题标题】:My App has no Client ID?我的应用程序没有客户端 ID?
【发布时间】:2016-01-26 17:57:54
【问题描述】:

所以我正在使用虚幻引擎 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 并安装在我的手机上。结果是一样的。

我四处寻找解决此问题的方法,但我的开发者控制台中的设置没有任何问题,也没有任何遗漏。我在这里有点不知所措,我的目标是在 2015 年 12 月发布,所以我需要帮助。 Epic Games 几乎没有关于提供执行此操作的节点的文档,所以所有这些都是我在黑暗中摸索的。

【问题讨论】:

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


    【解决方案1】:

    在黑暗中挣扎和摸索之后,我现在自己找到了解决方案。请关注this link 到虚幻论坛看看我是怎么做到的!

    它的基本要点是:

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

    • 适用于 Android 的 Google 云消息传递
    • 谷歌云发布/订阅
    • Google Cloud 用户帐户
    • Google Play Android 开发者 API
    • Google Play 游戏管理
    • Google Play 游戏服务
    • Google+ API

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

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

    • com.google.android.gms.games.APP_ID="@string/app_id"
    • com.google.android.gms.appstate.APP_ID="@string/app_id"

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

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

    打开 build 文件夹并在位于 <PROJECT NAME>\Build\Android\res\valuesGooglePlayAppID.xml 添加您的应用 ID

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

    现在您应该可以使用 Epic 提供的节点来实现成就、排行榜和应用内购买了。

    【讨论】:

    • 虽然此链接可能会回答问题,但最好在此处包含答案的基本部分并提供链接以供参考。如果链接页面发生更改,仅链接的答案可能会失效。
    • 我改变了答案。那个更好吗? :)
    • 是的。这样会好很多。
    【解决方案2】:

    另一个重要步骤(在虚幻论坛链接中)是对 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)

    【讨论】:

    • 只有自己构建才能做到这一点,但是是的,你是对的。我的只是纯粹的蓝图^^
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-12-01
    • 1970-01-01
    • 2020-09-28
    • 2019-09-30
    • 1970-01-01
    相关资源
    最近更新 更多