Reputation: 908
after upgrading my unity version to 2019.2.17 i get this error:
Exception: Field currentActivity or type signature not found UnityEngine._AndroidJNIHelper.GetFieldID (System.IntPtr jclass, System.String fieldName, System.String signature, System.Boolean isStatic)
when trying to get currentActivity with this code:
// Retrieve the UnityPlayer class.
unityPlayerClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
// Retrieve the UnityPlayerActivity object ( a.k.a. the current context )
unityActivity = unityPlayerClass.GetStatic<AndroidJavaObject>("currentActivity");
how can i resolve the problem?
Upvotes: 4
Views: 8482
Reputation: 129
Had a similar issue, and after my head went all bold, I noticed that I didn't get this problem when I switch off the device simulator!!!
Hope this be of help.
Upvotes: 0