google-signin-unity icon indicating copy to clipboard operation
google-signin-unity copied to clipboard

Exception: Field currentActivity or type signature not found

Open ghost opened this issue 5 years ago • 27 comments

I imported the plugin and sample scene packages into my project and when I click the Sign In button of the SignInSample scene, it throws me that error.

ghost avatar Mar 06 '20 00:03 ghost

Same issue here!

JimbobSlice avatar Mar 07 '20 12:03 JimbobSlice

+1, This only happens in editor tho when i build to an actual device it works without an issue

AssemDeghady avatar Mar 21 '20 01:03 AssemDeghady

Can build, but Android doesn't show signin (activated from Start)

MADiFoldStudio avatar Apr 10 '20 20:04 MADiFoldStudio

I ran into the same issue. In the editor I get the exception and when I run it in Android the app simply freezes. Is there a workaround?

The error occurs in GoogleSignInImpl.cs line 180:

return jc.GetStatic<UnityEngine.AndroidJavaObject>("currentActivity").GetRawObject();

henning101 avatar Jun 22 '20 18:06 henning101

I ran into the same issue. In the editor I get the exception and when I run it in Android the app simply freezes. Is there a workaround?

The error occurs in GoogleSignInImpl.cs line 180:

return jc.GetStatic<UnityEngine.AndroidJavaObject>("currentActivity").GetRawObject();

Nevermind, it does work in Android. The error was somewhere else.

henning101 avatar Jun 23 '20 15:06 henning101

@henning101 What did you do to resolve the issue?

luigimalgas avatar Aug 11 '20 08:08 luigimalgas

Same Problem. Even it is no error in mobile ,but I don't want to waste time build and run to test something new in mobile but not editor . It's so stupid.

Waterbludmouse avatar Aug 19 '20 13:08 Waterbludmouse

@henning101 What did you do to resolve the issue?

@luigimalgas "currentActivity" does not exist in the Unity editor because it is Android specific. My workaround was to just test the Google sign in the actual app and not in the editor.

henning101 avatar Aug 20 '20 09:08 henning101

@henning101 What did you do to resolve the issue?

@luigimalgas "currentActivity" does not exist in the Unity editor because it is Android specific. My workaround was to just test the Google sign in the actual app and not in the editor.

@henning101 Thank you for your response. I ran into another conflict between google-sigin and firebase packages for Unity. I got it resolved to but the google-signin did not quite extend to my needs for both a desktop and app based signin solution.

I then just wrote a generic implementation from the google api. I haven't tried the work around but I have seen others saying that the workaround does work. Has anyone tried it on an AVD?

luigimalgas avatar Aug 20 '20 10:08 luigimalgas

hi all i have got the same error and i have build on android and the app freeze. what is the problem ?

kalikane avatar Sep 17 '20 20:09 kalikane

Exception: Field currentActivity or type signature not found UnityEngine._AndroidJNIHelper.GetFieldID (System.IntPtr jclass, System.String fieldName, System.String signature, System.Boolean isStatic)

i got these error in editor in mobile crashing these because of multiple sdk i have to use firebase sdk auth, database, adMob, and google sign in after i install these sdk's i got conflict and some error regarding to external dependency manager and android resolver i solved some error by their doc but still many is coming unity or google should have to give proper sdk when install multiple google sdk same thing is instaling again and again or give something like proper doc

santhoshkumar15 avatar Sep 17 '20 20:09 santhoshkumar15

@santhoshkumar15 thank you for your answer.

kalikane avatar Sep 17 '20 20:09 kalikane

I ran into the same issue. In the editor I get the exception and when I run it in Android the app simply freezes. Is there a workaround? The error occurs in GoogleSignInImpl.cs line 180:

return jc.GetStatic<UnityEngine.AndroidJavaObject>("currentActivity").GetRawObject();

Nevermind, it does work in Android. The error was somewhere else.

I'm having the same issue in unityHelper and it doesn't even work on andorid.

dusan8 avatar Feb 14 '21 14:02 dusan8

For those experiencing freezing / crashing on Android, in my case I found it was an r8 / proguard issue. I've added these lines of code to the proguard rules and it works now:

-keep class com.google.googlesignin.** { *; }
-keep class com.google.android.gms.auth.** { *; }

cimved avatar Jun 10 '21 21:06 cimved

For those experiencing freezing / crashing on Android, in my case I found it was an r8 / proguard issue. I've added these lines of code to the proguard rules and it works now:

-keep class com.google.googlesignin.** { *; }
-keep class com.google.android.gms.auth.** { *; }

hi miscnz can you say that which file add this lines. i'm try adding to app_update.txt file on Proguard folder but it is not work

hakanhamzaoglu avatar Jun 28 '21 14:06 hakanhamzaoglu

@hakanhamzaoglu For me the issue was occurring because I had R8 turned on. If you also have it turned on, you can enable custom proguard settings in Player Settings > Publishing Settings, and add rules in Assets > Plugins > Android > proguard-user

cimved avatar Jun 30 '21 19:06 cimved

@hakanhamzaoglu For me the issue was occurring because I had R8 turned on. If you also have it turned on, you can enable custom proguard settings in Player Settings > Publishing Settings, and add rules in Assets > Plugins > Android > proguard-user

hi @micsnz thanks for your reply. i added like you say and works without problem. Great works! More thanks for your interesting

hakanhamzaoglu avatar Jun 30 '21 20:06 hakanhamzaoglu

@micsnz i tried what you said but my app is still crashing any other solutions?

keyurjain44 avatar Sep 09 '21 12:09 keyurjain44

@hakanhamzaoglu For me the issue was occurring because I had R8 turned on. If you also have it turned on, you can enable custom proguard settings in Player Settings > Publishing Settings, and add rules in Assets > Plugins > Android > proguard-user

What should i write in rules?

jevinSoni avatar Jun 04 '22 05:06 jevinSoni

Exception: Field currentActivity or type signature not found UnityEngine._AndroidJNIHelper.GetFieldID (System.IntPtr jclass, System.String fieldName, System.String signature, System.Boolean isStatic)

SubbulakshmiNagaraj avatar Sep 14 '22 12:09 SubbulakshmiNagaraj

Can build, but Android doesn't show signin (activated from Start)

Same issue but in my game it's not work on the pc so anyone have the solution.

Evil-Vibes avatar Nov 03 '22 11:11 Evil-Vibes

Can build, but Android doesn't show signin (activated from Start)

Same issue but in my game it's not work on the pc so anyone have the solution.

Both pc or android

Evil-Vibes avatar Nov 03 '22 11:11 Evil-Vibes

Having the same issue. I am not able to log in using google sign-in. Does not work on pc or on android.

Robert-Gamer avatar Jan 11 '23 04:01 Robert-Gamer

The issue is still not resolved yet, the google sdk is still 5 years old with no updates, it still throws the errors as "Exception: Field currentActivity or type signature not found"

itsAshhal avatar Sep 28 '24 16:09 itsAshhal