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

Update iOS pod to >= 5.0.0 and apply migrations for native plugin code.

Open lukezbihlyj opened this issue 5 years ago • 27 comments

Fixes for the updated GoogleSignIn iOS pod version 5.0.0+, see issue #122

lukezbihlyj avatar Feb 11 '20 20:02 lukezbihlyj

Hey @lukezbihlyj ,

Does your PR fixes this issue? *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'You must specify |clientID| for |GIDSignIn|'

Thank you very much.

Mukarillo avatar Feb 12 '20 20:02 Mukarillo

Hey @lukezbihlyj ,

Does your PR fixes this issue? *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'You must specify |clientID| for |GIDSignIn|'

Thank you very much.

That issue usually happens occurs when the app can't find your GoogleService-Info.plist file. I have an editor script that imports the file into the XCode project after the build has completed using this line:

project.AddFileToBuild(targetGuid, project.AddFile(googleServiceInfoPlistPath, "GoogleService-Info.plist"));

Take a look at the Unity docs for how to use the PBXProject class and there are probably some more comprehensive examples on the Unity forums as well.

lukezbihlyj avatar Feb 12 '20 20:02 lukezbihlyj

Thanks for the heads up, but I don't think thats my problem. I mean, I can see the GoogleService-Info.plist in xCode hierarchy. Do you have any other tip? Thanks again man!

Mukarillo avatar Feb 12 '20 20:02 Mukarillo

Thanks for the heads up, but I don't think thats my problem. I mean, I can see the GoogleService-Info.plist in xCode hierarchy. Do you have any other tip? Thanks again man!

I haven't personally seen that problem unfortunately. You could try adding some logs in here to make sure that the ID is getting extracted properly from your plist file: https://github.com/googlesamples/google-signin-unity/blob/588c0637310623d86c55d06f0adc72972b0bac22/GoogleSignInPlugin/Assets/Plugins/iOS/GoogleSignIn/GoogleSignInAppController.mm#L68-L79

lukezbihlyj avatar Feb 12 '20 20:02 lukezbihlyj

Thank you man. I am totally noob when it comes to native code, but I will figure it out. Thanks again!

Mukarillo avatar Feb 12 '20 20:02 Mukarillo

Well... that was quick, I created some logs just like you said and you were right, it was not being attached to the build. After clicking the file in xCode I saw that the Target Membership of my app was not selected.

Thank you very much for helping me out man :)

Mukarillo avatar Feb 12 '20 20:02 Mukarillo

@lukezbihlyj How to download your pull request as an unitypackage? or zip?

ragavendranbala avatar Apr 06 '20 05:04 ragavendranbala

@ragavendranbala You can download my branch as a .zip from here: https://github.com/lukezbihlyj/google-signin-unity/archive/master.zip

lukezbihlyj avatar Apr 06 '20 22:04 lukezbihlyj

Thank you so much for this! My app was getting rejected by Apple because of the ITMS-90809: UIWebView API Deprecation. v1.0.4 of this project uses GoogleSignIn v4.x.x which uses UIWebView. You need to run v5.0.0 or higher of GoogleSignIn. This pull request does that.

Admins, PLEASE merge this pull request. I'm a bit hesitant to include GoogleSignIn in my Unity project as this repo does not seem to be supported anymore. Hopefully people like lukezbihlyj and others will keep things working.

Thanks again

markyama avatar May 02 '20 19:05 markyama

Thanks for your insights and initiative @lukezbihlyj!

Are you guys using Unity 2019.3? The Xcode project structure has changed as of Unity 2019.3 according to https://docs.unity3d.com/Manual/StructureOfXcodeProject.html.

When checking the contents of the .ipa file: GoogleService-Info.plist moved in Unity 2019.3

  • Unity 2019.2: GoogleSignIn.bundle and GoogleService-Info.plist were under the root folder.
  • Unity 2019.3: GoogleSignIn.bundle and GoogleService-Info.plist are now moved to a subfolder inside Frameworks

Perhaps this is causing the 'You must specify |clientID| for |GIDSignIn|' error & crash on iOS https://github.com/googlesamples/google-signin-unity/issues/63...

anisabboud avatar May 07 '20 12:05 anisabboud

@ragavendranbala You can download my branch as a .zip from here: https://github.com/lukezbihlyj/google-signin-unity/archive/master.zip

@lukezbihlyj Im sorry, Im really noob about xcode. I download your branch as a zip, but what should I do in Unity? is it only to copy the Assets folder from zip to Unity Assets and build xcode and thats it?

or is there anything else I should do in Xcode, or where do I download that GoogleSignIn pod 5,0?

thanks so much..

pseudocolor avatar May 08 '20 16:05 pseudocolor

@pseudocolor

You don't need to download the project as a zip. You can just look at the diff in this PR and apply all the changes by hand. Also check your Podfile.lock that it has something like this image ... indicating that your version is any version greater than 5.0.0. If that's not the case, open the Podfile and make sure it has pod 'GoogleSignIn', '>= 5.0.0' in it (change it if you need to). Then (after backing it up first, to be safe) delete your Podfile.lock and have Unity/Xcode (not sure which one actually) recreate it by kicking off another build. The Podfile.lock should now have a version like in the screenshot. I just did all this with success.

Big thanks to @lukezbihlyj !!

nicolasgramlich avatar May 09 '20 07:05 nicolasgramlich

@lukezbihlyj since this project has been abandoned, maybe it's time to make a unofficial fork and provide a fixed unitypackage from there. I'll chip in $10 for the effort :)

nicolasgramlich avatar May 09 '20 08:05 nicolasgramlich

@nicolasgramlich have you created the unity package?

ragavendranbala avatar May 10 '20 11:05 ragavendranbala

@ragavendranbala sorry, I've never done that before and don't have the time for it while working on my game (shameless plug: https://play.google.com/store/apps/details?id=com.legioncommander ). If you have any problems let me know and I'll try to help out.

nicolasgramlich avatar May 11 '20 00:05 nicolasgramlich

If you have any problems let me know and I'll try to help out.

@nicolasgramlich will try that this night, thanks

pseudocolor avatar May 11 '20 09:05 pseudocolor

hey it worked!

thanks @lukezbihlyj , @nicolasgramlich

I just use what on the Assets folder of the zip in unity, but make sure your other sdk or unity package is safe. Unity ads is built in by default, and it should be upgraded first or just remove them since the default unity ads 2.0 on my Unity still use the uiwebview

pseudocolor avatar May 12 '20 09:05 pseudocolor

I have created the unity package here because I have to import to many projects. Tell me if there is some bug and thanks @lukezbihlyj for his work. Link to the upgrade unity package: https://drive.google.com/file/d/1N50K62jLxORVTI5xSNEc06o0xyFh9mvu/view?usp=sharing

napbla avatar Oct 01 '20 09:10 napbla

This update works well! Thanks for your efforts. However I'm coming across one problem. Those who have any idea to resolve this issue, please let me know. On every login, it is asking for permission. Sign-in silently function in android works well but in IOS, it gives the prompt for permission and upon approval, it leads to the google account and you have to choose your account everytime.

For reference, please look at this issue. Can it be because of changes made with this update? Please let me know the workaround. Issue 163

hafsaahmed96 avatar Nov 04 '20 03:11 hafsaahmed96

I think this PR must be merged into the main branch and release a new version. Without these changes, it's hard to build or submit to the AppStore.

rumaniel avatar Jan 13 '21 02:01 rumaniel

Agreed - it is ridiculous that a company as large as Google can't find anyone in their staff to actively maintain their own sign in plugin. More likely is that no one in their management is even aware of the issue. https://github.com/addyosmani https://github.com/jkammerl https://github.com/nic0lette https://github.com/PaulRashidi https://github.com/samtstern https://github.com/shrugs https://github.com/thagikura https://github.com/yaraki ^ talk to your managers and make sure they get someone assigned to this.

DarkStarSword avatar Jan 21 '21 07:01 DarkStarSword

@lukezbihlyj Google release 6.0.0 version recently, It seems couple of class removed/renamed.

viveksavsaiya avatar Jul 19 '21 13:07 viveksavsaiya

Since Google published GoogleSignIn 6.0.0, GoogleSignInDependencies.xml file should be like

<iosPods>
  <iosPod name="GoogleSignIn" version="~> 5.0.0" bitcodeEnabled="false"
      minTargetSdk="6.0">
  </iosPod>
</iosPods>

Notice the usage of ~>which means "take whatever starting from 5.0.0 until 6.0.0 (excluding 6.0.0)".

mustafacagataytulun avatar Jul 19 '21 14:07 mustafacagataytulun

Since Google published GoogleSignIn 6.0.0, GoogleSignInDependencies.xml file should be like

<iosPods>
  <iosPod name="GoogleSignIn" version="~> 5.0.0" bitcodeEnabled="false"
      minTargetSdk="6.0">
  </iosPod>
</iosPods>

Notice the usage of ~>which means "take whatever starting from 5.0.0 until 6.0.0 (excluding 6.0.0)".

Implemented this into my fork, sorry it took so long

lukezbihlyj avatar Aug 26 '21 01:08 lukezbihlyj

This should really be merged in to the official repo! It works perfectly for me.

djooryabi avatar Dec 14 '21 00:12 djooryabi

When will google merge this 🙄

UltraKenchie avatar Aug 10 '22 15:08 UltraKenchie

see https://github.com/googlesamples/google-signin-unity/pull/205

CodeMasterYi avatar Oct 21 '22 03:10 CodeMasterYi