This question was
closed May 02, 2020 at 07:25 PM by
greglieb for the following reason:
The question is answered, right answer was accepted
Question by
greglieb · May 04, 2020 at 09:55 AM ·
androidgooglenative pluginadb
Unity to Native Code Calls Wrong Function
I am using this flavor of Unity's Google Sign In Button. When I run the app on Android and try to sign in, an exception is thrown. The adb debugger stacktrace includes Facebook.Unity.IOS.IOSWrapper:.ctor() which is clearly wrong. How can I determine what is happening here?
The intended extern definition is as follows:
[DllImport(DllName)]
static extern IntPtr GoogleSignIn_SignIn(HandleRef self);
A single stack trace on Android's adb where the exception is thrown, caught, and printed looks like this:
04-30 20:09:58.142 4373 4474 I Unity : Exception of type 'Google.GoogleSignIn+SignInException' was thrown.
04-30 20:09:58.142 4373 4474 I Unity : Facebook.Unity.IOS.IOSWrapper:.ctor()
04-30 20:09:58.142 4373 4474 I Unity : System.Threading.ContextCallback:Invoke(Object)
04-30 20:09:58.142 4373 4474 I Unity : System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)
04-30 20:09:58.142 4373 4474 I Unity : System.Runtime.CompilerServices.MoveNextRunner:Run()
04-30 20:09:58.142 4373 4474 I Unity : System.Action:Invoke()
04-30 20:09:58.142 4373 4474 I Unity : System.Threading.ContextCallback:Invoke(Object)
04-30 20:09:58.142 4373 4474 I Unity : System.Threading.Tasks.AwaitTaskContinuation:RunCallback(ContextCallback, Object, Task&)
04-30 20:09:58.142 4373 4474 I Unity : System.Threading.Tasks.Task:FinishContinuations()
04-30 20:09:58.142 4373 4474 I Unity : System.Threading.Tasks.Task:Finish(Boolean)
04-30 20:09:58.142 4373 4474 I Unity : System.Threading.Tasks.Task`1:TrySetException(Object)
04-30 20:09:58.142 4373 4474 I Unity : System.Threading.Tasks.TaskCompletionSource`1:TrySetException(Exception)
04-30 20:09:58.142 4373 4474 I Unity : System.Threading.Tasks.TaskCompletionSource`1:SetException(Exception)
04-30 20:09:58.142 4373 4474 I Unity : Google.<WaitForResult>d__8:MoveNext()
04-30 20:09:58.142 4373 4474 I Unity : UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
04-30 20:09:58.142 4373 4474 I Unity :
04-30 20:09:58.142 4373 4474 I Unity : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
04-30 20:09:58.142 4373 4474 I Unity :
Comment
I solved this issue!
This was a configuration problem. I forgot to add my SHA keys to my Firebase Console settings. Print out the keys with this command:
keytool -keystore /path/to/my/keystore.keystore -list -v
Then add them to your Android app in the Firebase Console Settings https://console.firebase.google.com/u/0/