googlesamples / google-signin-unity

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

Can't build in iOS but in android works #108

Open mavc18 opened 4 years ago

mavc18 commented 4 years ago

I got this errors in xcode:

import <GoogleSignIn/GIDSignIn.h>

@interface GoogleSignInHandler : NSObject <GIDSignInDelegate, GIDSignInUIDelegate>

error 'Cannot find protocol declaration for 'GIDSignInUIDelegate'; did you mean 'GIDSignInDelegate'?' 2------ // Setup the Sign-In instance. GIDSignIn *signIn = [GIDSignIn sharedInstance]; signIn.clientID = clientId; signIn.uiDelegate = gsiHandler; signIn.delegate = gsiHandler;

error: 'Property 'uiDelegate' not found on object of type 'GIDSignIn *'; did you mean 'delegate'?'

3--------

error: 'No visible @interface for 'GIDSignIn' declares the selector 'handleURL:sourceApplication:annotation:'


anybody knows what is the problem? have been all week trying to fix that... i want to cry :(

steve6t6 commented 4 years ago

@mavc18 We too just ran into this exact same issue, I wonder if you have solved this by now?

FrankNine commented 4 years ago

You have to edit GoogleSignInDependencies.xml from

<iosPod name="GoogleSignIn" version=">= 4.0.2" bitcodeEnabled="false">

To

<iosPod name="GoogleSignIn" version="= 4.4.0" bitcodeEnabled="false">

This plugin does not support newer 5.x.x pod, so you have to pin pod version to latest 4.x.x version.

FrankNine commented 4 years ago

But then there is a bug where iOS version not always returning AuthCode and no one has a solution yet https://github.com/googlesamples/google-signin-unity/issues/66 So you might need to reconsider whether integrating this on iOS or not

triplumix commented 3 years ago

You have to edit GoogleSignInDependencies.xml from

<iosPod name="GoogleSignIn" version=">= 4.0.2" bitcodeEnabled="false">

To

<iosPod name="GoogleSignIn" version="= 4.4.0" bitcodeEnabled="false">

This plugin does not support newer 5.x.x pod, so you have to pin pod version to latest 4.x.x version.

Lower versions of GoogleSignIn use UIWebView and apps using UIWebView are not accepted anymore on iOS, hence using 4.x.x is not a solution anymore, since they won't accept the build on App Store.

I have the same issue... if I fix the error from this topic, my app won't be accepted on App Store, if I fix the UIWebView error, then I will get the error from this topic.

It seems that the best solution for now (for me) is to completely remove the Google signin.

FrankNine commented 3 years ago

I am currently using this fork: https://github.com/lukezbihlyj/google-signin-unity

To get 5.x.x pod working.

mcdenyer commented 3 years ago

I am currently using this fork: https://github.com/lukezbihlyj/google-signin-unity

To get 5.x.x pod working.

Ok so dumb question. What is the proper way to install this fork into project? Copying the folders in the GoogleSignInPlugin/assets folder and replacing existing files is resulting in errors.

FrankNine commented 3 years ago

Could you share the error message? I just moved files into the project. But we only use this plugin for iOS. On Android we request ID token via Play Games Plugin. The ID token obtained from both plugins are interchangeable.

mcdenyer commented 3 years ago

"Assets\GoogleSignIn\Future.cs(72,40): error CS0433: The type 'TaskCompletionSource' exists in both 'Unity.Tasks, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' and 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51':

someone made a package to update the 1.04 GoogleSignIn using the Lukezbihlyj fork that I eneded up using to fix is but I had to revert my project back and then used the package to import. That ended up working. I got it from the comments here: https://github.com/googlesamples/google-signin-unity/pull/126

FrankNine commented 3 years ago

Google add Tasks.dll to support Unity targeting .Net 3.5 and it will cause duplication error on Unity with .Net 4.5 since Tasks are built-in in .Net 4.5. You can safely remove Task.dll if you are using .Net 4.5

mcdenyer commented 3 years ago

Google add Tasks.dll to support Unity targeting .Net 3.5 and it will cause duplication error on Unity with .Net 4.5 since Tasks are built-in in .Net 4.5. You can safely remove Task.dll if you are using .Net 4.5

Thanks a lot!