You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AndroidJavaClass jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
if (jc == null) {
throw new System.Exception("Could not get class com.unity3d.player.UnityPlayer.");
}
AndroidJavaObject activity = jc.GetStatic<AndroidJavaObject>("currentActivity");
if (activity == null) {
throw new System.Exception("Could not get class current activity from UnityPlayer.");
}
return activity;
}
code:
internal AndroidJavaObject GetActivity() {
problem:
Exception: JNI: Init'd AndroidJavaClass with null ptr!
UnityEngine.AndroidJavaClass..ctor (IntPtr jclass)
UnityEngine.AndroidJavaObject.get_JavaLangClass ()
UnityEngine.AndroidJavaObject.FindClass (System.String name)
UnityEngine.AndroidJavaClass._AndroidJavaClass (System.String className)
UnityEngine.AndroidJavaClass..ctor (System.String className)
GooglePlayGames.Android.AndroidClient.GetActivity () (at assets/GooglePlayGames/Platforms/Android/AndroidClient.cs:271)
GooglePlayGames.Android.AndroidClient.RunOnUiThread (System.Action action) (at assets/GooglePlayGames/Platforms/Android/AndroidClient.cs:283)
GooglePlayGames.Android.AndroidClient..ctor () (at assets/GooglePlayGames/Platforms/Android/AndroidClient.cs:63)
GooglePlayGames.PlayGamesClientFactory.GetPlatformPlayGamesClient () (at assets/GooglePlayGames/Platforms/PlayGamesClientFactory.cs:26)
GooglePlayGames.PlayGamesPlatform.Authenticate (ILocalUser unused, System.Action
1 callback, Boolean silent) (at assets/GooglePlayGames/ISocialPlatform/PlayGamesPlatform.cs:157) GooglePlayGames.PlayGamesPlatform.Authenticate (ILocalUser localUser, System.Action
1 callback) (at assets/GooglePlayGames/ISocialPlatform/PlayGamesPlatform.cs:132)GooglePlayGames.PlayGamesLocalUser.Authenticate (System.Action`1 callback) (at assets/GooglePlayGames/ISocialPlatform/PlayGamesLocalUser.cs:36)
Game6_Player.Start () (at assets/game 6/script/Game6_Player.cs:124)
The text was updated successfully, but these errors were encountered: