Hi All!
I’m facing the error: Exception: Field currentActivity or type signature not found When i try to play the Start Scene on Player.
Platform Android
The only object is a Button that calls Signin with Google.
There are no errors on compilation, but when try to run the test on player shows the described error.
As per i saw on others posts, there is no way to play the APP on the player. Is this true? have to deploy and tes on a devica each change that i make to the app?
Hi, I’m facing the same issue, but my app doesn’t work at all, it freezes and crashes when I open it. I kind of understood it has something to do with UnityEngine.AndroidJNIModule and AndroidJavaObject but I’ve no idea how to solve it, it’s driving me mad. I’m trying to use Google Package Asset Delivery, but when it starts loading the package it calls this helper function
public static class UnityPlayerHelper
{
/// <summary>
/// Gets the current activity running in Unity. This object should be disposed after use.
/// </summary>
/// <returns>A wrapped activity object. The AndroidJavaObject should be disposed.</returns>
public static AndroidJavaObject GetCurrentActivity()
{
using (var unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
{
return unityPlayer.GetStatic<AndroidJavaObject>("currentActivity");
}
}
}
And I get this huge error:
Exception: Field currentActivity or type signature not found
UnityEngine._AndroidJNIHelper.GetFieldID (System.IntPtr jclass, System.String fieldName, System.String signature, System.Boolean isStatic) (at <1b8d7d6285464cff8aa5ccc91decf4f7>:0)
UnityEngine.AndroidJNIHelper.GetFieldID (System.IntPtr javaClass, System.String fieldName, System.String signature, System.Boolean isStatic) (at <1b8d7d6285464cff8aa5ccc91decf4f7>:0)
UnityEngine._AndroidJNIHelper.GetFieldID[ReturnType] (System.IntPtr jclass, System.String fieldName, System.Boolean isStatic) (at <1b8d7d6285464cff8aa5ccc91decf4f7>:0)
UnityEngine.AndroidJNIHelper.GetFieldID[FieldType] (System.IntPtr jclass, System.String fieldName, System.Boolean isStatic) (at <1b8d7d6285464cff8aa5ccc91decf4f7>:0)
UnityEngine.AndroidJavaObject._GetStatic[FieldType] (System.String fieldName) (at <1b8d7d6285464cff8aa5ccc91decf4f7>:0)
UnityEngine.AndroidJavaObject.GetStatic[FieldType] (System.String fieldName) (at <1b8d7d6285464cff8aa5ccc91decf4f7>:0)
Google.Play.Common.UnityPlayerHelper.GetCurrentActivity () (at Assets/GooglePlayPlugins/com.google.play.common/Runtime/Scripts/UnityPlayerHelper.cs:32)
Google.Play.AssetDelivery.Internal.AssetPackManager…ctor () (at Assets/GooglePlayPlugins/com.google.play.assetdelivery/Runtime/Scripts/Internal/AssetPackManager.cs:33)
Google.Play.AssetDelivery.Internal.PlayAssetDeliveryInternal…ctor () (at Assets/GooglePlayPlugins/com.google.play.assetdelivery/Runtime/Scripts/Internal/PlayAssetDeliveryInternal.cs:44)
Google.Play.AssetDelivery.PlayAssetDelivery.get_Instance () (at Assets/GooglePlayPlugins/com.google.play.assetdelivery/Runtime/Scripts/PlayAssetDelivery.cs:32)
Google.Play.AssetDelivery.PlayAssetDelivery.RetrieveAssetBundleAsync (System.String assetBundleName) (at Assets/GooglePlayPlugins/com.google.play.assetdelivery/Runtime/Scripts/PlayAssetDelivery.cs:57)
I solved this by reverting changes I had done the day before. I had commented out code to do with initialising google play and it resulted in this error when trying to call in app review.
Hi,
i had the same issue. Probably most of you could figure out that the AppUpdateManager is causing this error. For me this meant that building android apk was possible, but “build and run” wasn’t.
I used to initialize the AppUpdateManager as member variable like this:
private AppUpdateManager appUpdateManager = new AppUpdateManager();
I fixed it by moving it into Awake() and checking for the platform, like this:
private void Awake()
{
if (Application.platform == RuntimePlatform.Android)
{
this.appUpdateManager = new AppUpdateManager();
}
}
Of course, the remaining code that is relying on the AppUpdateManager, also only runs when the platform is Android.
I’m on the 2D team so unfortunately not. This is why I moved this thread to scripting as it has a higher chance of someone knowing unlike it being on an inappropriate forum. Sorry.