Play-games-plugin-for-unity: 'GoogleSignIn/GIDSignIn.h' file not found, This time in Cloud Build

Created on 16 Mar 2017  ·  3Comments  ·  Source: playgameservices/play-games-plugin-for-unity

10360:        [xcode] /BUILD_PATH/marcus13345.<ProjectName>.<CloudConfigName>/temp.KhQ73w/
                      Libraries/Plugins/iOS/GPGSAppController.mm:20:9:
                      fatal error: 'GoogleSignIn/GIDSignIn.h' file not found
10361:        [xcode] #import <GoogleSignIn/GIDSignIn.h>
10362:        [xcode] 1 error generated.

I'm running in to the error described above and in a few other issues, namely #1009 .

Where I'm working in Cloud Build, I cant directly use XCode's GUI. To get around that, I've created a post build script that I believe should work, however it yields no effect. It is working, as I can see values changing in the project file, but the error persists. I'm unsure if this is my wrong doing or potentially a bug with the way Cloud Build and this plugin interact.

Edit: Updated Gist to include setting compiler flags as per PR #1579

Any insight would be appreciated!

Most helpful comment

Thanks for the details - iOS and Play Games has definitely had its problems. Unfortunately, GPGS has been deprecated for iOS: https://android-developers.googleblog.com/2017/04/focusing-our-google-play-games-services.html

All 3 comments

I've been struggling with this for way too long too. I'm not using the cloud build tho.
I sometimes think I should remove google admob and google play games from my games as it's so complicated and frustrating on iOS (really easy on android).

This was already terrible a year ago:

Here's a few related issues

You may have a look to the tldr section of my comment here (scroll down):
https://github.com/playgameservices/play-games-plugin-for-unity/issues/1459#issuecomment-256520049

But according to your gist, it sounds like you're doing it right.

I personally tried 5.1.0, 5.1.1 and 5.1.2.

  • 5.1.0 and 5.1.2, I'm getting same error as you.
  • 5.1.1 has undeclared kGTMOAuth2ErrorTokenUnavailable because it uses GoogleSignIn 4.0.2 instead of GoogleSignIn 2.4.0

(╯°□°)╯︵ ┻━┻

So you could try this:
https://github.com/playgameservices/play-games-plugin-for-unity/issues/1549#issuecomment-271636988

Delete previous version of playgameservices completely:

rm -rf Assets/GooglePlayGames/
rm -rf Assets/Plugins/iOS/GPGS*
# other files from your playgameservices installation

Upgrade to playgameservices 0.9.36. Then, in Unity, click Assets > Play Services Resolver > Version handler > Update.

But you'll end up with the same error.

edit: In my case, $(inherited) was missing in two of these:

  • Other C Flags
  • Other linker flags
  • Header Search Paths

Once correctly set, I managed to build the project! 🎉

Maybe your lines fail to add $(inherited), but I tested locally and it seems to do the trick. Maybe you have to run some cleanups on the cloud side?

Or maybe you need to tell the cloud to run cocoapods. I personally use Jenkins and I use a shell script to build everything.

In my PostBuild.cs (similar to yours) I have this function executed at the end to run a shell script:

    static void ExecuteShellScript (string pathToBuiltProject)
    {
        Debug.Log ("PostBuild started for " + pathToBuiltProject);
        string script = "postbuild.sh";
        string localPath = "Assets/Editor/" + script;
        try {
            var bin = Directory.GetCurrentDirectory () + Path.DirectorySeparatorChar + localPath;
            var process = new Process ();
            process.StartInfo.FileName = bin;
            process.StartInfo.WorkingDirectory = pathToBuiltProject;
            Debug.Log ("PostBuild running: " + bin);
            Debug.Log ("PostBuild WorkingDirectory: " + pathToBuiltProject);
            bool result = process.Start ();
            Debug.Log ("PostBuild result: " + result);
        } catch (Exception e) {
            Debug.LogError (e);
        }
    }

_But I'm not using that csharp snippet as I find it easier to invoke the shell script from jenkins itself_. I use rbenv to setup cocoapod, etc.

postbuild.sh looks something like this (make sure it's executable, chmod +x postbuild.sh):

#!/usr/bin/env bash
set -x # adds verbosity

unity_project_path=${1:-"../.."} # 1st script param, defaults to "../.."
ios_build_path=${2:-"."} # 2nd script param, defaults to "."

# Sync Podfile
cp ${unity_project_path}/Assets/Editor/Podfile ${ios_build_path}/Podfile
# Installs pods
pod install

# Removes GoogleSignIn CFBundleExecutable because wtf
# http://stackoverflow.com/questions/32622899/itms-90535-unable-to-publish-ios-app-with-latest-google-signin-sdk
/usr/libexec/PlistBuddy -c "Delete :CFBundleExecutable" ${ios_build_path}/Pods/GoogleSignIn/Resources/GoogleSignIn.bundle/Info.plist

Hope this helps

Thanks for the details - iOS and Play Games has definitely had its problems. Unfortunately, GPGS has been deprecated for iOS: https://android-developers.googleblog.com/2017/04/focusing-our-google-play-games-services.html

Oh, definitely good to know, thanks for taking the time to post here :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

temresen picture temresen  ·  4Comments

SQuirkster picture SQuirkster  ·  3Comments

bibbis picture bibbis  ·  4Comments

lolmourne picture lolmourne  ·  3Comments

toxikman picture toxikman  ·  4Comments