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

Can't build in iOS but in android works

Open mavc18 opened this issue 5 years ago • 10 comments

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

  • Handle the auth URL */
  • (BOOL)GoogleSignInAppController:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { BOOL handled = [self GoogleSignInAppController:application openURL:url sourceApplication:sourceApplication annotation:annotation];

    return [[GIDSignIn sharedInstance] handleURL:url sourceApplication:sourceApplication annotation:annotation] ||

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 :(

mavc18 avatar Sep 01 '19 05:09 mavc18

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

steve6t6 avatar Oct 08 '19 12:10 steve6t6

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 avatar Oct 14 '19 04:10 FrankNine

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

FrankNine avatar Oct 14 '19 04:10 FrankNine

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.

triplumix avatar Oct 26 '20 13:10 triplumix

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

To get 5.x.x pod working.

FrankNine avatar Oct 27 '20 05:10 FrankNine

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.

mcdenyer avatar Mar 23 '21 03:03 mcdenyer

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.

FrankNine avatar Mar 23 '21 18:03 FrankNine

"Assets\GoogleSignIn\Future.cs(72,40): error CS0433: The type 'TaskCompletionSource<T>' 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

mcdenyer avatar Mar 23 '21 22:03 mcdenyer

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

FrankNine avatar Mar 24 '21 15:03 FrankNine

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!

mcdenyer avatar Mar 24 '21 17:03 mcdenyer