【问题标题】:Unity3D Google Play Games: NoSuchMethodError when calling AuthenticateUnity3D Google Play 游戏:调用 Authenticate 时出现 NoSuchMethodError
【发布时间】:2014-10-13 00:47:38
【问题描述】:

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

当我尝试显示我的排行榜或成就时,我收到以下消息:

好像authentication总是返回false。

目前用户只能登录 google play。

10-11 11:39:17.972 I/Unity (16208): AndroidJavaException: java.lang.NoSuchMethodError: no method with name='getClass' signature='()Ljava/lang/Object;'在 Lcom/google/android/gms/common/api/b 类中; 10-11 11:39:17.972 I/Unity (16208): 在 UnityEngine.AndroidJNISafe.CheckException () [0x00000] in :0 10-11 11:39:17.972 I/Unity (16208): 在 UnityEngine.AndroidJNISafe.GetMethodID (IntPtr obj, System.String name, System.String sig) [0x00000] in :0 10-11 11:39:17.972 I/Unity (16208): 在 UnityEngine._AndroidJNIHelper.GetMethodID (IntPtr jclass, System.String methodName, System.String signature, Boolean isStatic) [0x00000] in :0 10-11 11:39:17.972 I/Unity (16208): 在 UnityEngine.AndroidJNIHelper.GetMethodID (IntPtr javaClass, System.String methodName, System.String signature, Boolean isStatic) [0x00000] in :0 10-11 11:39:17.972 I/Unity (16208): 在 UnityEngine._AndroidJNIHelper.GetMethodIDAndroidJavaObject [0x00000] in :0 10-11 11:39:17.972 I/Unity (16208): 在 UnityEngine.AndroidJNIHelper.GetMethodID[AndroidJavaObject] (IntPtr jclass, System.String methodName, System.Object[] arg 10-11 11:39:19.617 W/ActivityManager(2155):ActivityRecord 的活动暂停超时{4232ec38 co.uk.gringames.hungrybobproject/com.unity3d.player.UnityPlayerNativeActivity} 10-11 11:39:38.747 I/Unity (16208): AndroidJavaException: java.lang.NoSuchMethodError: no method with 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 () [0x00000] in :0 10-11 11:39:38.747 I/Unity (16208): 在 UnityEngine.AndroidJNISafe.GetMethodID (IntPtr obj, System.String name, System.String sig) [0x00000] in :0 10-11 11:39:38.747 I/Unity (16208): 在 UnityEngine._AndroidJNIHelper.GetMethodID (IntPtr jclass, System.String methodName, System.String signature, Boolean isStatic) [0x00000] in :0 10-11 11:39:38.747 I/Unity (16208): 在 UnityEngine.AndroidJNIHelper.GetMethodID (IntPtr javaClass, System.String methodName, System.String signature, Boolean isStatic) [0x00000] in :0 10-11 11:39:38.747 I/Unity (16208): 在 UnityEngine._AndroidJNIHelper.GetMethodIDAndroidJavaObject [0x00000] in :0 10-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);
        }
            }
}

请帮忙!

亲切的问候,

丹尼尔

【问题讨论】:

    标签: unity3d google-play-games nosuchmethoderror


    【解决方案1】:

    我今天遇到了同样的问题。显然在 13 日有一个更新提交到 GitHub 存储库(见 https://github.com/playgameservices/play-games-plugin-for-unity/commit/eb70764bf8795de051520b3262745ef35c204c17#diff-bedb7e4c95811a7313c6e4ba5f18875f ) 这似乎可以解决问题。我合并了 head 中的所有更改,我的应用运行正常。

    【讨论】:

      猜你喜欢
      • 2021-04-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-02-04
      • 2014-06-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多