Field currentActivity or type signature not found Error in Player Unity 2020.1

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?

Hope you can helpme!!!

I have the same problem.Have you found the reason?

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)

Hi All,

I am getting the same error. My setup however is UnityEngine 2019.4.16f1. I am trying to learn Play Asset Delivery from the example on Using Play Asset Delivery in Unity games  |  Android Developers.

Hope somebody can help.

Cheers,
Heiwa-Games

Hi All, I’m getting the same error. Has anyone found a solution?

The same error guys, HELP

I get this error while integrating fb ads. Help

5 Likes

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.

Does anyone got any solution to this i am also getting the same error

Same error while using the following asset Contact List !!! Any Idea Guys???

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 hope this will help some of you.

2 Likes

me tooo brother have you founded the solution of how to resolve it??

Me too

hey bro did you get the solution ???

1 Like

if you get the solution ,please post here

1 Like

hey ,did you get the solution ??

This is nothing to do with 2D at all. Moving it to scripting.

1 Like

@MelvMay
I did not get exact reason for this error . can you help liitle bit

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.

1 Like

@MelvMay
I tried all solution which are available on internet:( . but I did not get any logistic way:eyes::eyes:
Any approach sir @MelvMay

error is like :
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 ()