4

I am getting this error:

ERROR: GPGSAppController.mm GIDSignIn.h File not found error

I am using Google Play Game Service plugin for Unity for leaderboard and Achievements, and every thing is working fine in android but when I build to IOS and try to run my project to an iOS device I keep getting this error and I couldn't find a solution to it for hours now.

I tried to deleted everything related to Google Play service (After creating a back up of course) and the app installed and worked ok, except it was a bit laggy but that is a another issue. So I'm sure the problem comes from Google Play Service, but I have no clue how to fix it. Again I'm new to Xcode and iOS development in general and even Mac.

I also get this message after building the project in Unity:

TO FINISH CONFIGURING THE EXPORTED XCODE PROJECT

  1. Add these frameworks:

    AddressBook.framework
    AssetsLibrary.framework
    CoreData.framework
    CoreTelephony.framework
    CoreText.framework
    Security.framework
    libc++.dylib
    libz.dylib

  2. Add the following bundles and frameworks from the Google Plus and the Google Play Games C++ SDKs. These can be downloaded from https://developers.google.com/games/services.

    GoogleOpenSource.framework
    GoogleSignId.bundle
    GoogleSignId.framework
    gpg.bundle
    gpg.framework

    Note: Make sure the bundles are copied to application. This can be verified under Build Phases/Copy Bundle Resources.

  3. Add the '-ObjC' linker flag. To do this, select the top-level project object, select the 'Unity-iPhone' build target, then go to the Build Settings tab. Search for Other Linker Flags and add the '-ObjC' flag to that list.

** Note: To run in the simulator, use Unity 4.6.8 or greater.

ios_instructions on plugin repository

But I have no idea how to do any thing above as am not familiar with iOS development. Any help is appreciated.

GabLeRoux
  • 16,715
  • 16
  • 63
  • 81
  • Maybe try applying instructions from this message? Furthermore, implementing Google Play services on iOS is just a bad idea in my opinion. – Rafal Wiliński Nov 16 '15 at 09:22
  • @RafalWiliński I'd like to know why this would be a bad idea. When using Unity with https://github.com/playgameservices/play-games-plugin-for-unity I suppose you get additional informations on Google Developer dashboard for your game if it's linked and available for both Android and iOS. – GabLeRoux May 18 '16 at 03:57

2 Answers2

2

@aimozs answer was right for indicating where to add required files, a few google search gave me the answers;

From instructions (didn't work for me, scroll down)

AddressBook.framework
AssetsLibrary.framework
CoreData.framework
CoreTelephony.framework
CoreText.framework
Security.framework
libc++.dylib
libz.dylib

These can all be located directly when linking frameworks. (In my case, libc++.dylib and libz.dylib were already linked, and I couldn't find them somehow, but regenerating your xcode project should add these two again.

GoogleOpenSource.framework

I've found it here:
https://developers.google.com/+/mobile/ios/getting-started#step_1_creating_the_console_name_project

GoogleSignId.bundle
GoogleSignId.framework

Found them in:
https://developers.google.com/identity/sign-in/ios/sdk/
(I grabbed latest version Google Sign-In SDK 3.0.0)

gpg.bundle
gpg.framework

I found them here:
https://developers.google.com/games/services/downloads/sdks
(Grabbed Play Games C++ SDK Version 2.1)

Also, the following part of the message seemed important:

Make sure the bundles are copied to application

I tried to copy bundle files to root of the project, but I still get the same error.

Solution: CocoaPods and the podfile!

I saw the PodFile in xcode project directory!.
Here you go; make sure you followed these steps: https://github.com/playgameservices/play-games-plugin-for-unity#ios-setup

Then see https://cocoapods.org/

sudo gem install cocoapods
pod repo update
pod install
open Unity-iPhone.xcworkspace

Way better than manually copying files everywhere! ;)

Note: I also had to disable bitecode because I was having a linker error concerning GoogleOpenSource:

You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE)

It doesn't seem to be compiled with bitcode enabled, solution in here: how to ENABLE_BITCODE in xcode 7?

Build, enjoy and focus on making awesome games!

Linked questions

There's also a small discussion here:
http://forum.unity3d.com/threads/googleplus-googleplus-h-file-not-found-gpgsappcontroller-mm-xcode.294398/

A similar issue on UnityAnswers:
http://answers.unity3d.com/questions/1098655/gpgsappcontrollermm-gidsigninh-file-not-found-erro.html

Community
  • 1
  • 1
GabLeRoux
  • 16,715
  • 16
  • 63
  • 81
-1

Im going through that aswell, and for #1 it has to be done in xcode, here's a screenshot of how to add those libs

And that is for #3

Hope that helps :) and I'll get back to you about #2 when I've found out about it ;)

aimozs
  • 54
  • 5