创建GameServices对象时出错

时间:2014-11-22 21:04:26

标签: android plugins unity3d google-play-services google-play-games

尝试验证本地用户时,我看到发生了下一个异常:

I/Unity   (11264):  [Play Games Plugin DLL] 11/22/14 12:32:38 -05:00 DEBUG: Activating PlayGamesPlatform.
I/Unity   (11264):  [Play Games Plugin DLL] 11/22/14 12:32:38 -05:00 DEBUG: PlayGamesPlatform activated: GooglePlayGames.PlayGamesPlatform
I/Unity   (11264):  [Play Games Plugin DLL] 11/22/14 12:32:38 -05:00 DEBUG: Creating platform-specific Play Games client.
I/Unity   (11264):  [Play Games Plugin DLL] 11/22/14 12:32:38 -05:00 DEBUG: Creating real IPlayGamesClient

D/GamesUnitySDK(11264): Performing Android initialization of the GPG SDK

I/Unity   (11264): InvalidOperationException: There was an error creating a GameServices object. Check for log errors from GamesNativeSDK
I/Unity   (11264):   at GooglePlayGames.Native.PInvoke.GameServicesBuilder.Build (GooglePlayGames.Native.PInvoke.PlatformConfiguration configRef) [0x00000] in <filename unknown>:0 
I/Unity   (11264):   at GooglePlayGames.Native.NativeClient.InitializeGameServices () [0x00000] in <filename unknown>:0 
I/Unity   (11264):   at GooglePlayGames.Native.NativeClient.Authenticate (System.Action`1 callback, Boolean silent) [0x00000] in <filename unknown>:0 
I/Unity   (11264):   at GooglePlayGames.PlayGamesPlatform.Authenticate (System.Action`1 callback, Boolean silent) [0x00000] in <filename unknown>:0 
I/Unity   (11264):   at GooglePlayGames.PlayGamesPlatform.Authenticate (System.Action`1 callback) [0x00000] in <filename unknown>:0 
I/Unity   (11264):   at GooglePlayGames.PlayGamesLocalUser.Authenticate (System.Action`1 callback) [0x00000] in <filename unknown>:0 

GamesNativeSDK的错误:

E/GamesNativeSDK(11264): Can't register class com/google/android/gms/games/snapshot/SnapshotContents: an exception occurred.
E/GamesNativeSDK(11264): Could not register one or more required Java classes.

这个错误意味着什么,我该如何解决?

我正在使用Google Play Games plugin for Unity提供的最新版本:

2 个答案:

答案 0 :(得分:4)

仅供将来参考,@ mrggl还说:

  

堆栈溢出线程中引用的错误主要是由   Google Play服务客户端库的过时版本。   确保您已更新到最新版本,然后重新运行   在Google Play游戏中安装Android,然后重试。

以防错误为准,see the same issue

答案 1 :(得分:0)

https://github.com/playgameservices/play-games-plugin-for-unity/issues/280部分解决了这个问题。

@mrggl说:

  

这可能是当前插件具有的问题   对libc ++ _ shared.so的传递依赖 - 就是这种情况,链接   静态地反对标准库可能会解决这个问题。

     

我在这里提交了一个静态链接的libgpg版本:   https://github.com/playgameservices/play-games-plugin-for-unity/tree/debug_libgpg/debug。   用这些覆盖旧版本的libgpg并查看是否存在   解决了这个问题!