【发布时间】:2015-12-22 14:09:43
【问题描述】:
好的,所以我之前已经成功地将 GPGS 应用到了许多游戏中,但现在它似乎不起作用。我加载游戏,它只是不会做任何事情,没有登录对话框或任何东西。这是我用来登录的代码:
using UnityEngine;
using System.Collections;
using UnityEngine.SocialPlatforms;
using GooglePlayGames;
using GooglePlayGames.BasicApi;
public class GpgsStart : MonoBehaviour {
void Start () {
PlayGamesPlatform.Activate ();
Social.localUser.Authenticate((bool success) => {
if(!success)
{
PlayerPrefs.SetString("SignIn", "false");
Debug.Log("Couldn't Sign In");
}
});
}
// Update is called once per frame
void Update () {
}
}
我真的不明白为什么它不起作用,我想知道我是否犯了一个愚蠢的错误或我错过了什么。有谁知道是什么导致了我的探测?
非常感谢任何帮助,谢谢。
这是 logcat 输出:
I/Unity ( 9861): InvalidOperationException: There was an error creating a Game
Services object. Check for log errors from GamesNativeSDK
I/Unity ( 9861): at GooglePlayGames.Native.PInvoke.GameServicesBuilder.Build
(GooglePlayGames.Native.PInvoke.PlatformConfiguration configRef) [0x00000] in <
filename unknown>:0
I/Unity ( 9861): at GooglePlayGames.Native.NativeClient.InitializeGameServic
es () [0x00000] in <filename unknown>:0
I/Unity ( 9861): at GooglePlayGames.Native.NativeClient.Authenticate (System
.Action`1 callback, Boolean silent) [0x00000] in <filename unknown>:0
I/Unity ( 9861): at GooglePlayGames.PlayGamesPlatform.Authenticate (System.A
ction`1 callback, Boolean silent) [0x00000] in <filename unknown>:0
I/Unity ( 9861): at GooglePlayGames.PlayGamesPlatform.Authenticate (System.A
ction`1 callback) [0x00000] in <filename unknown>:0
I/Unity ( 9861): at GooglePlayGames.PlayGamesLocalUser.Authenticate (System.
Action`1 callback) [0x00000] in <filename unknown>:0
I/Unity ( 9861): at GpgsStart.Start () [0x00000] in <filename unknown>:0
I/Unity ( 9861):
I/Unity ( 9861): (Filename: Line: -1)
I/Unity ( 9861):
V/WindowManager( 451): Window{422852e8 u0 Keyguard}mOrientationRequetedFromKeyg
uard=false
【问题讨论】:
-
你的日志猫说什么?手机设置可能有问题?
-
我拥有的所有其他应用程序都可以使用,这与应用程序有关。我不知道如何用 Unity 登录,你能告诉我吗?如果这有什么不同,我目前正在更新 SDK 管理器中的 GPGS rev。
-
基本上转到终端/命令提示符并输入“adb logcat”,或者如果这不起作用,请转到您的 Android SDK 文件夹 > 平台工具,然后输入“./adb logcat”。它将实时显示您手机中的所有内容,包括您的 GPGS 应用程序的任何例外情况。
-
在命令提示符中显示“''adb' 未被识别为内部或外部命令、可运行程序或批处理文件。”,
-
好的,我添加了 logcat 输出。
标签: android unity3d google-play-games