playgameservices / play-games-plugin-for-unity

Google Play Games plugin for Unity
Other
3.44k stars 959 forks source link

java.lang.NoSuchMethodError for 'com.google.android.gms.tasks.OnFailureListener' and 'com.google.android.gms.tasks.OnSuccessListener' #3009

Open oddgames-david opened 3 years ago

oddgames-david commented 3 years ago

I have 30+ examples of this error showing on a range of devices and android versions. It only does this for OnFailureListener and OnSuccessListener.

The method name is most times empty but sometimes it's random strings found elsewhere in the game, even strings that are just in our localization or dates.

When we report achievements or scores we are using an anonymous delegate since we don't care about the result but we also see the error when using OpenWithAutomaticConflictResolution.

Social.Active.ReportProgress(achievementID, progress, (success) => { });
Social.Active.ReportScore(score, leaderboardID, (success) => { });

It seems like com.unity3d.player.ReflectionHelper.getMethodID is struggling to get the correct method name.

Stack traces:

AndroidJavaException: java.lang.NoSuchMethodError: no non-static method with name='' signature='(Lcom.google.android.gms.tasks.OnSuccessListener;)Ljava/lang/Object;' in class Lcom.google.android.gms.tasks.zzw;
java.lang.NoSuchMethodError: no non-static method with name='' signature='(Lcom.google.android.gms.tasks.OnSuccessListener;)Ljava/lang/Object;' in class Lcom.google.android.gms.tasks.zzw;
com.unity3d.player.ReflectionHelper.getMethodID(Unknown Source:162)
com.unity3d.player.UnityPlayer.nativeRender(Native Method)
com.unity3d.player.UnityPlayer.access$300(Unknown Source:0)
com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:95)
android.os.Handler.dispatchMessage(Handler.java:105)
android.os.Looper.loop(Looper.java:166)
com.unity3d.player.UnityPlayer$e.run(Unknown Source:20)
UnityEngine.AndroidJNISafe.CheckException () (at <00000000000000000000000000000000>:0)
UnityEngine.AndroidJNISafe.CallStaticObjectMethod (System.IntPtr clazz, System.IntPtr methodID, UnityEngine.jvalue[] args) (at <00000000000000000000000000000000>:0)
UnityEngine.AndroidReflection.GetMethodMember (System.IntPtr jclass, System.String methodName, System.String signature, System.Boolean isStatic) (at <00000000000000000000000000000000>:0)
UnityEngine._AndroidJNIHelper.GetMethodID (System.IntPtr jclass, System.String methodName, System.String signature, System.Boolean isStatic) (at <00000000000000000000000000000000>:0)
UnityEngine.AndroidJavaObject._Call[ReturnType] (System.String methodName, System.Object[] args) (at <00000000000000000000000000000000>:0)
GooglePlayGames.Android.AndroidTaskUtils.AddOnSuccessListener[T] (UnityEngine.AndroidJavaObject task, System.Action`1[T] callback) (at <00000000000000000000000000000000>:0)
GooglePlayGames.Android.AndroidClient.LoadAchievements (System.Action`1[T] callback) (at <00000000000000000000000000000000>:0)

AndroidJavaException: java.lang.NoSuchMethodError: no non-static method with name='' signature='(Lcom.google.android.gms.tasks.OnSuccessListener;)Ljava/lang/Object;' in class Ljava.lang.Object;
java.lang.NoSuchMethodError: no non-static method with name='' signature='(Lcom.google.android.gms.tasks.OnSuccessListener;)Ljava/lang/Object;' in class Ljava.lang.Object;
com.unity3d.player.ReflectionHelper.getMethodID(Unknown Source:162)
com.unity3d.player.UnityPlayer.nativeRender(Native Method)
com.unity3d.player.UnityPlayer.access$300(Unknown Source:0)
com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:95)
android.os.Handler.dispatchMessage(Handler.java:105)
android.os.Looper.loop(Looper.java:166)
com.unity3d.player.UnityPlayer$e.run(Unknown Source:20)
UnityEngine.AndroidJNISafe.CheckException () (at <00000000000000000000000000000000>:0)
UnityEngine.AndroidJNISafe.CallStaticObjectMethod (System.IntPtr clazz, System.IntPtr methodID, UnityEngine.jvalue[] args) (at <00000000000000000000000000000000>:0)
UnityEngine.AndroidReflection.GetMethodMember (System.IntPtr jclass, System.String methodName, System.String signature, System.Boolean isStatic) (at <00000000000000000000000000000000>:0)
UnityEngine._AndroidJNIHelper.GetMethodID (System.IntPtr jclass, System.String methodName, System.String signature, System.Boolean isStatic) (at <00000000000000000000000000000000>:0)
UnityEngine.AndroidJavaObject._Call[ReturnType] (System.String methodName, System.Object[] args) (at <00000000000000000000000000000000>:0)
GooglePlayGames.Android.AndroidTaskUtils.AddOnSuccessListener[T] (UnityEngine.AndroidJavaObject task, System.Action`1[T] callback) (at <00000000000000000000000000000000>:0)
GooglePlayGames.Android.AndroidClient.LoadAchievements (System.Action`1[T] callback) (at <00000000000000000000000000000000>:0)
GooglePlayGames.PlayGamesPlatform.ReportProgress (System.String achievementID, System.Double progress, System.Action`1[T] callback) (at <00000000000000000000000000000000>:0)

AndroidJavaException: java.lang.NoSuchMethodError: no non-static method with name='2.TOR.Indexes.LevelPasses' signature='(Lcom.google.android.gms.tasks.OnSuccessListener;)Ljava/lang/Object;' in class Ljava.lang.Object;
java.lang.NoSuchMethodError: no non-static method with name='2.TOR.Indexes.LevelPasses' signature='(Lcom.google.android.gms.tasks.OnSuccessListener;)Ljava/lang/Object;' in class Ljava.lang.Object;
com.unity3d.player.ReflectionHelper.getMethodID(Unknown Source:162)
com.unity3d.player.UnityPlayer.nativeRender(Native Method)
com.unity3d.player.UnityPlayer.access$300(Unknown Source:0)
com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:95)
android.os.Handler.dispatchMessage(Handler.java:105)
android.os.Looper.loop(Looper.java:166)
com.unity3d.player.UnityPlayer$e.run(Unknown Source:20)
UnityEngine.AndroidJNISafe.CheckException () (at <00000000000000000000000000000000>:0)
UnityEngine.AndroidJNISafe.CallStaticObjectMethod (System.IntPtr clazz, System.IntPtr methodID, UnityEngine.jvalue[] args) (at <00000000000000000000000000000000>:0)
UnityEngine.AndroidReflection.GetMethodMember (System.IntPtr jclass, System.String methodName, System.String signature, System.Boolean isStatic) (at <00000000000000000000000000000000>:0)
UnityEngine._AndroidJNIHelper.GetMethodID (System.IntPtr jclass, System.String methodName, System.String signature, System.Boolean isStatic) (at <00000000000000000000000000000000>:0)
UnityEngine.AndroidJavaObject._Call[ReturnType] (System.String methodName, System.Object[] args) (at <00000000000000000000000000000000>:0)
GooglePlayGames.Android.AndroidTaskUtils.AddOnSuccessListener[T] (UnityEngine.AndroidJavaObject task, System.Action`1[T] callback) (at <00000000000000000000000000000000>:0)
GooglePlayGames.Android.AndroidSavedGameClient.InternalOpen (System.String filename, GooglePlayGames.BasicApi.DataSource source, GooglePlayGames.BasicApi.SavedGame.ConflictResolutionStrategy resolutionStrategy, System.Boolean prefetchDataOnConflict, GooglePlayGames.BasicApi.SavedGame.ConflictCallback conflictCallback, System.Action`2[T1,T2] completedCallback) (at <00000000000000000000000000000000>:0)
Gerjo commented 3 years ago

To chime in as well; we've been seeing this error too in our products. Android 10 through 7 (possibly more, reporting software shows just the frequent platforms).

It appears to happen with any GooglePlayGames interaction. Two example stacktraces below. Plugin version is 0.10.09 (Unity 2018.4) we have not yet updated to latest plugin as the changelog does not indicate a fix.

I presume this is possibly a threading issue inside the plugin. It's annoying, but not frequent enough for concern.

Managed Stack Trace:

java.lang.NoSuchMethodError: no non-static method with name='' signature='(Lcom.google.android.gms.tasks.OnSuccessListener;)Ljava/lang/Object;' in class Lcom.google.android.gms.tasks.zzu;
com.unity3d.player.ReflectionHelper.getMethodID(Unknown Source:167)
com.unity3d.player.UnityPlayer.nativeRender(Native Method)
com.unity3d.player.UnityPlayer.c(Unknown Source:0)
com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:95)
android.os.Handler.dispatchMessage(Handler.java:102)
android.os.Looper.loop(Looper.java:164)
com.unity3d.player.UnityPlayer$e.run(Unknown Source:20)
UnityEngine.AndroidJNISafe.CheckException () (at <00000000000000000000000000000000>:0)
UnityEngine.AndroidJNISafe.CallStaticObjectMethod (System.IntPtr clazz, System.IntPtr methodID, UnityEngine.jvalue[] args) (at <00000000000000000000000000000000>:0)
UnityEngine.AndroidReflection.GetMethodMember (System.IntPtr jclass, System.String methodName, System.String signature, System.Boolean isStatic) (at <00000000000000000000000000000000>:0)
UnityEngine._AndroidJNIHelper.GetMethodID (System.IntPtr jclass, System.String methodName, System.String signature, System.Boolean isStatic) (at <00000000000000000000000000000000>:0)
UnityEngine.AndroidJNIHelper.GetMethodID (System.IntPtr javaClass, System.String methodName, System.String signature, System.Boolean isStatic) (at <00000000000000000000000000000000>:0)
UnityEngine._AndroidJNIHelper.GetMethodID[ReturnType] (System.IntPtr jclass, System.String methodName, System.Object[] args, System.Boolean isStatic) (at <00000000000000000000000000000000>:0)
UnityEngine.AndroidJNIHelper.GetMethodID[ReturnType] (System.IntPtr jclass, System.String methodName, System.Object[] args, System.Boolean isStatic) (at <00000000000000000000000000000000>:0)
UnityEngine.AndroidJavaObject._Call[ReturnType] (System.String methodName, System.Object[] args) (at <00000000000000000000000000000000>:0)
GooglePlayGames.Android.AndroidTaskUtils.AddOnSuccessListener[T] (UnityEngine.AndroidJavaObject task, System.Action`1[T] callback) (at <00000000000000000000000000000000>:0)
GooglePlayGames.Android.AndroidSavedGameClient.InternalOpen (System.String filename, GooglePlayGames.BasicApi.DataSource source, GooglePlayGames.BasicApi.SavedGame.ConflictResolutionStrategy resolutionStrategy, System.Boolean prefetchDataOnConflict, GooglePlayGames.BasicApi.SavedGame.ConflictCallback conflictCallback, System.Action`2[T1,T2] completedCallback) (at <00000000000000000000000000000000>:0)
GooglePlayGames.Android.AndroidSavedGameClient.OpenWithManualConflictResolution (System.String filename, GooglePlayGames.BasicApi.DataSource source, System.Boolean prefetchDataOnConflict, GooglePlayGames.BasicApi.SavedGame.ConflictCallback conflictCallback, System.Action`2[T1,T2] completedCallback) (at <00000000000000000000000000000000>:0)
java.lang.NoSuchMethodError: no non-static method with name='' signature='(Lcom.google.android.gms.tasks.OnSuccessListener;)Ljava/lang/Object;' in class Lcom.google.android.gms.tasks.zzu;
com.unity3d.player.ReflectionHelper.getMethodID(Unknown Source:167)
com.unity3d.player.UnityPlayer.nativeRender(Native Method)
com.unity3d.player.UnityPlayer.c(Unknown Source:0)
com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:95)
android.os.Handler.dispatchMessage(Handler.java:102)
android.os.Looper.loop(Looper.java:164)
com.unity3d.player.UnityPlayer$e.run(Unknown Source:20)
UnityEngine.AndroidJNISafe.CheckException () (at <00000000000000000000000000000000>:0)
UnityEngine.AndroidJNISafe.CallStaticObjectMethod (System.IntPtr clazz, System.IntPtr methodID, UnityEngine.jvalue[] args) (at <00000000000000000000000000000000>:0)
UnityEngine.AndroidReflection.GetMethodMember (System.IntPtr jclass, System.String methodName, System.String signature, System.Boolean isStatic) (at <00000000000000000000000000000000>:0)
UnityEngine._AndroidJNIHelper.GetMethodID (System.IntPtr jclass, System.String methodName, System.String signature, System.Boolean isStatic) (at <00000000000000000000000000000000>:0)
UnityEngine.AndroidJNIHelper.GetMethodID (System.IntPtr javaClass, System.String methodName, System.String signature, System.Boolean isStatic) (at <00000000000000000000000000000000>:0)
UnityEngine._AndroidJNIHelper.GetMethodID[ReturnType] (System.IntPtr jclass, System.String methodName, System.Object[] args, System.Boolean isStatic) (at <00000000000000000000000000000000>:0)
UnityEngine.AndroidJNIHelper.GetMethodID[ReturnType] (System.IntPtr jclass, System.String methodName, System.Object[] args, System.Boolean isStatic) (at <00000000000000000000000000000000>:0)
UnityEngine.AndroidJavaObject._Call[ReturnType] (System.String methodName, System.Object[] args) (at <00000000000000000000000000000000>:0)
GooglePlayGames.Android.AndroidTaskUtils.AddOnSuccessListener[T] (UnityEngine.AndroidJavaObject task, System.Action`1[T] callback) (at <00000000000000000000000000000000>:0)
GooglePlayGames.Android.AndroidClient.LoadScores (System.String leaderboardId, GooglePlayGames.BasicApi.LeaderboardStart start, System.Int32 rowCount, GooglePlayGames.BasicApi.LeaderboardCollection collection, GooglePlayGames.BasicApi.LeaderboardTimeSpan timeSpan, System.Action`1[T] callback) (at <00000000000000000000000000000000>:0)
GooglePlayGames.PlayGamesPlatform.LoadScores (System.String leaderboardId, GooglePlayGames.BasicApi.LeaderboardStart start, System.Int32 rowCount, GooglePlayGames.BasicApi.LeaderboardCollection collection, GooglePlayGames.BasicApi.LeaderboardTimeSpan timeSpan, System.Action`1[T] callback) (at <00000000000000000000000000000000>:0)