playgameservices / play-games-plugin-for-unity

Google Play Games plugin for Unity
Other
3.47k stars 966 forks source link

'GIGSignIn.h' file not found #1094

Closed cr545l closed 8 years ago

cr545l commented 8 years ago

I'm developing in Unity 5.3.4f and Xcode 7.3 with the latest GPG 0.9.32 plugin. I've installed cocoa pods and am working from the generated Xcode file. When I try to build, I receive the following error: 2016-04-07 5 53 05 Adding #import < GoogleSignIn/GIDSignIn.h> did not help: 2016-04-07 6 20 28

traunay commented 8 years ago

I solved this by adding the GIDsignin framework manually (even if I already open the workspace instead of the projcet)

cr545l commented 8 years ago

@traunay How You Then?

claywilkinson commented 8 years ago

When you built the xcode project in Unity were there errors in the console? Make sure you are:

  1. opening the .xcworkspace file.
  2. OTHER_LDFLAGS in build settings include $(inherited)
  3. HEADER_SEARCH_PATHS in build settings include $(inherited)
  4. OTHER_CFLAGS in build settings include $(inherited)
  5. ENABLE_BITCODE in build settings is set to NO
  6. Libraries/Plugins/iOS/GPGSAppController.mm (or Libraries/GPGSAppController.mm) has compiler flags that include -fobjc-arc
cr545l commented 8 years ago

@claywilkinson Thank you! but, not found xcworkspace file. i use xcodeproj.

claywilkinson commented 8 years ago

If you run pod update in the generated xcode project, it will create the xcworkspace file. This references the Unity project, and the project generated by cocoapods which contains the frameworks needed to compile. Otherwise, you'll need to follow the instructions to compile when not using cocoapods.

cr545l commented 8 years ago

@claywilkinson THANK YOU!! i build success ! My solution is

  1. Install cocoapods, and xcworkspace build after open (But failed. Not found unityAds.h)
  2. Remove UnityAds (But failed. Not found GIDSignIn.h)
  3. Solution of @claywilkinson
  4. SUCCESS!
SilkyPants commented 8 years ago

Firstly - thanks @claywilkinson for the tips to fix this locally :)

I've been experiencing the same issue with the latest Xcode 7.3 update. It seems as if maybe the file format of the PBX has changed?

Platform: OSX 10.11.4 Xcode Version: 7.3 (7D175)

To confirm this I have installed Xcode 7.2.1 side by side with the latest, and run my build script (as we have a separate build machine to handle building nightly/development builds for us). When I point to the 7.2.1 install everything builds as planned, but when I switch to 7.3 I get errors in the PBXProject parser on line 0 (see issue #1082), which looks like it will then fail to add the required build settings to build correctly.

I'm not sure how Unity creates the Xcode project, but if I have 7.2.1 install at /Applications/Xcode, and 7.3 installed elsewhere (in my case /Application/Xcode-7.3) I can generate the project, then open with 7.3 and build fine (short of a problem with integrating Admob as well, but that's a separate issue #938).

I hope this can help some other users that might have a similar setup to us :)

claywilkinson commented 8 years ago

Thanks for the additional information. I'm glad you got it working!

Hyperkettu commented 7 years ago

I have the same problem, cannot find GIDSignIn.h in Xcode project. I am using the newest Unity and as I understood right, the Cocoapods should be run in Unity automatically as post build step but it appears not to do that. "This plugin uses another plugin called the Unity Jar Resolver, which handles resolving the dependencies needed for this plugin. When building for iOS in Unity, a post build step is executed that runs Cocoapods and then adds the required libraries and frameworks directly to the XCode project. This is different from previous versions; you no longer need to open the workspace in XCode."

I have successfully installed Cocoapods so that should not be the problem. The problem is propably that Unity does not run Cocoapods as post build step. Actually I can't find any Podfiles either in GooglePlayGames/Editor folder. What should I do? @claywilkinson

SilkyPants commented 7 years ago

@Hyperkettu - The podfile that gets moved is in Assets/GooglePlayGames/Platforms/IOS/GPGS-Podfile. FTR this is my current version (I had changed it to use the latest 5.1 version instead of it explicitly requesting it, but I cant remember what for exactly right now)

platform :ios, '7.0'

target 'Unity-iPhone' do
pod 'GooglePlayGames', '~> 5.1'
end

target 'Unity-iPhone Tests' do
pod 'GooglePlayGames', '~> 5.1'
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end

Looking over the code - I can't find where it calls pod install anymore, as it seems to have been removed @claywilkinson ? I have been using a class I created for merging CocoaPod files as a post build step https://gist.github.com/SilkyPantsDan/fbaa7f7727fb181f869f5d51c1365e9d as there was a conflict between AdMob and GPGS pod files.