Unity3D Google Play游戏:调用Authenticate时出现NoSuchMethodError



我正在使用来自以下来源的Unity3D的Google Play Services插件https://github.com/playgameservices/play-games-plugin-for-unity

当我试图展示我的排行榜或成就时,我会收到这样的消息:

验证似乎总是返回false。

现在用户只能登录谷歌播放。

10-11 11:39:17.972 I/Unity(16208):AndroidJava异常:java.lang.NoSuchMethodError:没有名称为'getClass'签名为'()Ljava/lang/Object;'的方法在类Lcom/google/android/gms/common/api/b中;10-11 11:39:17.972 I/Unity(16208):在UnityEngine.AndroidJNISafe.CheckException()[0x0000]中:010-11 11:39:17.972 I/Unity(16208):在UnityEngine.AndroidJNISafe.GetMethodID(IntPtr obj,System.String name,System.String sig)[0x0000]中:010-11 11:39:17.972 I/Unity(16208):在UnityEngine_AndroidJNIHelper.GetMethodID(IntPtr jclass,System.String methodName,System.String签名,Boolean isStatic)[0x0000]位于:010-11 11:39:17.972 I/Unity(16208):在UnityEngine.AndroidJNIHelper.GetMethodID(IntPtr javaClass,System.String methodName,System.String签名,布尔值为静态)[0x0000]in:010-11 11:39:17.972 I/Unity(16208):在UnityEngine_AndroidJNIHelper.GetMethodIDAndroidJavaObject[0x0000]位于:010-11 11:39:17.972 I/Unity(16208):在UnityEngine.AndroidJNIHelper.GetMethodID[AndroidJavaObject](IntPtr jclass,System.String methodName,System.Object[]arg10-11 11:39:19.617 W/ActivityManager(2155):ActivityRecord的活动暂停超时{4232ec38 co.uk.gringgames.hungrybobproject.com/unity3d.player.UnityPlayerNativeActivity}10-11 11:39:38.747 I/Unity(16208):AndroidJava异常:java.lang.NoSuchMethodError:没有name='getClass'signature='()Ljava/lang/Object;'的方法在类Lcom/google/android/gms/common/api/b中;10-11 11:39:38.747 I/Unity(16208):在UnityEngine.AndroidJNISafe.CheckException()[0x0000]in:010-11 11:39:38.747 I/Unity(16208):在UnityEngine.AndroidJNISafe.GetMethodID(IntPtr obj,System.String name,System.String sig)[0x0000]中:010-11 11:39:38.747 I/Unity(16208):在UnityEngine_AndroidJNIHelper.GetMethodID(IntPtr jclass,System.String methodName,System.String签名,Boolean isStatic)[0x0000]位于:010-11 11:39:38.747 I/Unity(16208):在UnityEngine.AndroidJNIHelper.GetMethodID(IntPtr javaClass,System.String methodName,System.String签名,布尔值为静态)[0x0000]in:010-11 11:39:38.747 I/Unity(16208):在UnityEngine_AndroidJNIHelper.GetMethodIDAndroidJavaObject[0x0000]位于:010-11 11:39:38.747 I/Unity(16208):在UnityEngine.AndroidJNIHelper.GetMethodID[AndroidJavaObject](IntPtr jclass,System.String methodName,System.Object[]arg

    //leaderboard strings
private string leaderboard = "sasaa";
//achievement strings
// Use this for initialization
void Awake()
{
    PlayGamesPlatform.Activate();
}
public void GooglePlayGames(string process)
{
    if (process == "login") {
                    Social.localUser.Authenticate ((bool success) =>
                    {
                            if (success) {
                                    Debug.Log ("You've successfully logged in");
                            } else {
                                    Debug.Log ("Login failed for some reason");
                            }
                    });
            } else if (process == "lead") {
        if (!Social.localUser.authenticated) {
        }else{
                ((PlayGamesPlatform)Social.Active).ShowLeaderboardUI (leaderboard);
        }
            }
}

请帮忙!

诚挚的问候,

Daniel

我今天遇到了同样的问题。显然,GitHub存储库在13日进行了更新(请参阅https://github.com/playgameservices/play-games-plugin-for-unity/commit/eb70764bf8795de051520b3262745ef35c204c17#diff-床这似乎解决了问题。我合并了head的所有更改,我的应用程序运行正常。

最新更新