-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Google SignIn with raw plugin and UPM #240
base: master
Are you sure you want to change the base?
Conversation
> convert to direct unity call to java add signin in editor and desktop support
08010fc
to
49623a2
Compare
Hi @Thaina We implemented your package but facing issues.
This error when we switch platforms other than iOS. |
|
Are you able to build for Android? |
Yes. actually had been only built for android at first Maybe something changed after I try to make it buildable on macos, let me test a bit |
It built to android normally in my windows machine My project is 2023.1.11 with netstandard 2.1 and IL2CPP backend |
Maybe you also need to install new version of dotnet too? |
Tried in Unity 2023.1 but still had the same issue. Not understand what caused the issue? |
Now it's working fine in Unity 2022.3.10 with netstandard 2.1. |
Hello @Thaina, I installed the plugin by copying the files and I encountered several.
the |
Thank you for your report. It seem the constructor of Could you backup your project and try in 2022.2 ? I will try to find the solution later |
Thank you for quick reply, I'll try with 2022.2 LTS and get back to you. |
I have update new version to hack and call internal constructor with reflection. I have test and seem to work in unity 2021.3.20 |
@Thaina after switching to 2022.3 LTS it worked! |
I will check it out. Also does this version ship with androidX lib? if yes how can I remove it as I have installed another plugin that ships with latest androidX lib. |
I don't think I have put any lib in my project. But I have add that this new version will require external dependency manager (google jar resolver) It was also specified In my case, I have always set my unity project to use With config to enabled |
When building with stripping to android signIn works but signOut throws: AndroidJavaException: java.lang.NoSuchMethodError: no static method with name='signOut' signature='(Lcom.google.googlesignin.GoogleSignInFragment;)V' in class Ljava.lang.Object; Also proguard does NOT help with Any idea why? |
I don't know a thing about stripping though. Is it work for you without stripping? |
Yes it works without stripping, but I found the solution, in the googleImpl the sign out method takes an activity parameter but an android object is passed instead of parentActivity. |
Could you please tell me the line number? That's weird reason when it work without stripping |
I had the same error as @NilokiloxD and was able to fix it by changing |
Fix signOut and disconnect
Thank you very much. I have update the code as you suggest |
@Thaina The app crashes when signin is called and cancelled. Also can we get events when the signin is called? like when a user cancels the google account selection prompt or cancels on permission page? |
@pinnakkkk Are there any error log I can see? About the event though, the signIn function is direct call so there should not need side effect event. I think anyone could wrap it in their own system instead And if user cancelled or any other kind of unsuccessful login, the correct behaviour is the task (Future) would return null |
So the app crashes when u have signed in, closed the app and try to sign in again. Logs
|
Sorry I misunderstand it. I think it is short for 'Unity Package Manager', right? |
@Thaina can confirm same behavior on IOS too. |
Pixel2,when clicked Button “Sign in”, after select account, the app crashed. But when build in mono, it worked. Unity2021.3.21f1 2023-12-14 17:50:37.247 3258-3258/com.. D/SignInFragment: onActivityResult: 9009 -1 |
Yes |
@pinnakkkk I now try to pinpoint which code that try to access null and make the crash. Still not found which. It was not crash in my device, only error |
@jfschmakeit I think that might be about gradle setting, such as androidx and jetifier |
seems it was needed...
Fixes & Improvements
I have made a new branch that migrate this package into the new version of google signin system |
HttpListener
(require clientSecret property)