Skip to content

'You must specify |clientID| for |GIDSignIn|' #63

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

Open
samavan opened this issue Sep 26, 2018 · 15 comments
Open

'You must specify |clientID| for |GIDSignIn|' #63

samavan opened this issue Sep 26, 2018 · 15 comments

Comments

@samavan
Copy link

samavan commented Sep 26, 2018

Full error from Xcode :

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'You must specify |clientID| for |GIDSignIn|'

For now I am just build the demo scene provided from an empty project.
Nothing fency.
Unity Build Settings BundleId matches with the clients ID.

I made many client ID for different platform, tried all of them and always having the same error.
I edit the WebClientId from the Signing Sample Script from the demo scene.
screen shot 2018-09-26 at 12 33 13

Any idea what do I do wrong?....

Thank you! :)

@samavan
Copy link
Author

samavan commented Sep 26, 2018

Also did this :
After generating the XCode project from Unity, download the GoogleService-Info.plist file from the Google Developers website and add it to your XCode project.

But error remains :
screen shot 2018-09-26 at 14 14 27

@doggan
Copy link

doggan commented Oct 2, 2018

The clientId gets set here:
https://github.com/googlesamples/google-signin-unity/blob/master/GoogleSignInPlugin/Assets/Plugins/iOS/GoogleSignIn/GoogleSignInAppController.mm#L65-L79

Make sure it's actually being loaded from your plist here. You can set a breakpoint or add some debug logging to figure out what's going on.

@korober
Copy link

korober commented Jan 28, 2019

@doggan thank you, in my case the problem was in the plist's file name... When you downloads plist file from Google Console, it's name looks like 'client_xxxxxxxxxx.apps.googleusercontent.com.plist', but file name should be "GoogleService-Info.plist"

@shadesbelow
Copy link

ya, the plist needs to be called "GoogleService-Info.plist" and it needs to be added to the root of the xcode project. also you need to create a url scheme with the reverse client id.

@dhruvmodhapp
Copy link

I have same issue. I tried to renaming downloaded plist to 'GoogleService-Info.plist'. Still there is issue ou must specify |clientID| for |GIDSignIn|.
I also put reverse client id to xcode setting.

@highpockets
Copy link

highpockets commented Mar 24, 2020

Has anyone solved this yet?? I'm having the issue now and I have GoogleService-Info.plist in my root with the client ID and the reverse client id..

@highpockets
Copy link

This was a simple target membership issue in xcode for me. The GoogleService-Info.plist was in the root, but the Target Membership of it was just set to UnityFramework, when I included my build target 'Unity-iPhone' it all worked out

@pmse18
Copy link

pmse18 commented Apr 29, 2020

@highpockets I am having the same issue, while trying Google Sign In in my iPhone, it is crashing with 'You must specify |clientID| for |GIDSignIn|'.
I have included the Google-Service-Info.plist file in the root also. But don't know what does this mean :

""but the Target Membership of it was just set to UnityFramework, when I included my build target 'Unity-iPhone' it all worked out""

Can you help me with it?

@CyanDeveloper
Copy link

@highpockets I am having the same issue, while trying Google Sign In in my iPhone, it is crashing with 'You must specify |clientID| for |GIDSignIn|'.
I have included the Google-Service-Info.plist file in the root also. But don't know what does this mean :

""but the Target Membership of it was just set to UnityFramework, when I included my build target 'Unity-iPhone' it all worked out""

Can you help me with it?

Hi!
After select the Google-Service-Info.plist file from the "Project navigator" window, you will see on the right the "Target Membership" section. Add the check mark to you application and try rebuild te app.
It works for me!

@highpockets
Copy link

@highpockets I am having the same issue, while trying Google Sign In in my iPhone, it is crashing with 'You must specify |clientID| for |GIDSignIn|'.
I have included the Google-Service-Info.plist file in the root also. But don't know what does this mean :

""but the Target Membership of it was just set to UnityFramework, when I included my build target 'Unity-iPhone' it all worked out""

Can you help me with it?

@pmse18 sorry for the late reply!! Did you sort it out?? My explanation was pretty bare, but it’s just like @CyanDeveloper says

@ayazthegunner
Copy link

ayazthegunner commented Sep 30, 2020

This was a simple target membership issue in xcode for me. The GoogleService-Info.plist was in the root, but the Target Membership of it was just set to UnityFramework, when I included my build target 'Unity-iPhone' it all worked out

does anyone know how can we do this through unity pbxproject? I am using cloud to build my project and facing the same crash issue.

@creativeIKEP
Copy link

creativeIKEP commented Oct 20, 2020

This was a simple target membership issue in xcode for me. The GoogleService-Info.plist was in the root, but the Target Membership of it was just set to UnityFramework, when I included my build target 'Unity-iPhone' it all worked out

Thanks you for your comments.
I haved same problem, but my app work after GoogleService-Info.plist file's Target Membership change 'UnityFramework' to 'Unity-iPhone'!!

@ayazthegunner

This was a simple target membership issue in xcode for me. The GoogleService-Info.plist was in the root, but the Target Membership of it was just set to UnityFramework, when I included my build target 'Unity-iPhone' it all worked out

does anyone know how can we do this through unity pbxproject? I am using cloud to build my project and facing the same crash issue.

It was realized auto Target Membership changing with bellow code.
I hope it your helps...

[PostProcessBuild(999)]
    public static void OnPostProcessBuild(BuildTarget buildTarget, string buildPath)
    {
        var projPath = buildPath + "/Unity-iPhone.xcodeproj/project.pbxproj";
        var proj = new PBXProject();
        proj.ReadFromFile(projPath);

        var targetGuid = proj.GetUnityMainTargetGuid();
        var googleServeiceInfoGuid = proj.FindFileGuidByProjectPath("GoogleService-Info.plist");
        //turn off 'UnityFramework' Target Membership
        proj.RemoveFileFromBuild(proj.GetUnityFrameworkTargetGuid(), googleServeiceInfoGuid);
        //turn on 'Unity-iPhone' Target Membership
        proj.AddFileToBuild(targetGuid, googleServeiceInfoGuid);

        proj.WriteToFile(projPath);
    }

@derwaldgeist
Copy link

Just learned that you also have to add an URL scheme to the app.

This can be done here:
https://docs.unity3d.com/Manual/PlayerSettingsiOS-Other.html#Configuration

The URL scheme is the same as the same as the Reverse Client ID. Guys, this is really f*** complex.

@derwaldgeist
Copy link

derwaldgeist commented Nov 17, 2020

An easier way to get the .plist into your Xcode project is to copy it to the StreamingAssets folder inside Unity, and then place this script under an Editor folder:

using UnityEditor;
using UnityEditor.Callbacks;
using UnityEditor.iOS.Xcode;

public static class GoogleSignInPostBuild {

[PostProcessBuild(999)]
public static void OnPostProcessBuild(BuildTarget buildTarget, string buildPath)
{
    var projPath = buildPath + "/Unity-iPhone.xcodeproj/project.pbxproj";
    var proj = new PBXProject();
    proj.ReadFromFile(projPath);
    var targetGuid = proj.GetUnityMainTargetGuid();
    proj.AddFileToBuild(targetGuid, proj.AddFile("Data/Raw/GoogleService-Info.plist", "GoogleService-Info.plist"));
    proj.WriteToFile(projPath);
}

}

It copies the file to the root of the project and sets the correct target.

If you do this and add the URL scheme as described above, you should be fine.

@xmx77
Copy link

xmx77 commented Aug 7, 2021

Hello, i will talk about my Scenario, i spent 4 day to understand my issue.
I have this issue " |clientID| for |GIDSignIn|" like you, and i am used firebase just for "Cloud message"
I do everything in document (client id ,URL scheme ... etc) but still have issue....
Today i show i have two project in my google console one for (Firebase) and anther one for (credentials) and allows GoogleService-Info.plist is take (client id for Firebase not for my anther project "credentials").
that is my issue and i fixed.
I hope there is no one doing like me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests