googlesamples / google-signin-unity

Google Sign-In API plugin for Unity game engine. Works with Android and iOS.
Other
424 stars 229 forks source link

Exception: Field currentActivity or type signature not found #133

Open ghost opened 4 years ago

ghost commented 4 years ago

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.

JimbobSlice commented 4 years ago

Same issue here!

AssemDeghady commented 4 years ago

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

MADiFoldStudio commented 4 years ago

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

henning101 commented 4 years ago

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 commented 4 years ago

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.

luigimalgas commented 4 years ago

@henning101 What did you do to resolve the issue?

Waterbludmouse commented 4 years ago

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.

henning101 commented 4 years ago

@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.

luigimalgas commented 4 years ago

@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?

kalikane commented 4 years ago

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

santhoshkumar15 commented 4 years ago

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

kalikane commented 4 years ago

@santhoshkumar15 thank you for your answer.

dusan8 commented 3 years ago

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.

cimved commented 3 years ago

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.** { *; }
hakanhamzaoglu commented 3 years ago

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

cimved commented 3 years ago

@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

hakanhamzaoglu commented 3 years ago

@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

keyurjain44 commented 3 years ago

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

jevinSoni commented 2 years ago

@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?

SubbulakshmiNagaraj commented 2 years ago

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

Evil-Vibes commented 2 years ago

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 commented 2 years ago

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

Robert-Gamer commented 1 year ago

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

itsAshhal commented 1 month ago

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"

Omri93h commented 4 days ago

same problem here