Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

~Pods/Headers/Public/Google/Google/SignIn.h:1:9: 'GGLCore/GGLCore.h' file not found

OS 10.10.5

xcode 7.2

Objective-C

iOS 9.2

CocoaPods 1.0.1

pod 'GoogleMaps'
pod 'Google/SignIn'
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'
pod 'AFNetworking'
pod 'MBProgressHUD', '~> 0.9.2'
pod 'CardIO'
pod "PubNub"

ERROR, in file 'SignIn.h', 'GGLCore/GGLCore.h' file not found

But, the GoogleCore API is in it.

'SignIn.h' is in Google Sign In framework, so I cannot modify the import from <GGLCore/GGLCore.h> to "GGLCore.h"

I really don't know how to do it now.

like image 998
afyzgh Avatar asked Jun 09 '16 00:06

afyzgh


1 Answers

I'm not so sure this is a solution as more of a somewhat larger list of things to look at to try and solve the problem. If you notice an issue with any of these things it may narrow your search to what's going on.

TLDR

(Everything is explained in more detail below)

  1. Make sure you're opening the .xcworkspace file instead of .xcproj file after installing CocoaPods

  2. As usual when Xcode trips out, always try to clean (Product > Clean Build Folder), and/or delete Derived Data (Xcode > Preferences > Locations > click on the arrow next to the Derived Data folder location) and force quit and reopen. Then rebuild once you launch Xcode

  3. Go to your target, and under Build Settings, find the Linking section and make sure your Other Linking Flags options has $(inherited) (Tapping on the it will expand that out to an actual list where you should be able to see your pod).

  4. If you don't see a path to your pod in Header Search Paths or you don't see libPods-YourProject.a in your the General tab (not Build Settings) under the Frameworks, Libraries, and Embedded Content you could try what I wrote below including a link to another post with more details, but chances are it'll be easier to just remove Cocapods (pod deintegrate) and re-integrate/install before going too deep down the rabbit hole.


Rambling Detailed Explanation

Have you tried option clicking to see if it will actually take you to the file? Sometimes Xcode will complain that it doesn't exist but that paradoxically take you to it when you try option clicking. This can hopefully be solved without resorting to the linking/search paths discussion I go into below but cleaning the project and other stuff.

But that being said, the first course of action with this should always be to Clean (Product>Clean) the project, and force quit Xcode. On a similar course of action as this you should also try cleaning AND deleting Derived Data before launching Xcode (Xcode > Preferences > Locations > click on the arrow next to the Derived Data folder location).

Another silly mistake that can result in this is opening the .xcproj file instead of .xcworkspace after installing Cocoapods.

Now assuming this doesn't work, you'll probably want to make sure Cocoapods properly linked everything. If you go to your Build settings and specifically click on the Target: like this:

You're going to want to make sure that libPods-YourProject.a is in the Linked Frameworks and Library section (will probably be giving you multiple other errors if somehow this wasn't the case but I'll just mention it to be complete). If it's not then that's some weird issue with Cocoapods and I would probably recommend installing pods again, or removing and adding Cocoapods to your project.

Similarly, if you click on Build Settings now, and scroll down to Linking there is an option called Other Linker Flags. Make sure there is a flag you have flags that say: $(inherited). Under that Cocoapods should have added a bunch of flags that start with -l"PodName" I'm not 100% positive here now because you have header files in addition to an extra frameworks folder, but what I think you should see is a -l"Google" flag and then under all the -l"name" flags you will see additional two line flags:

Make sure there is one that says -framework "GGLCore"

Now you're also probably going to want to check your search paths. So still under the Build Settings scroll a further down until you reach the Search Paths options. Make sure you're Framework Search Paths also has $(inherited) and you should see explicit search paths on the right (not when you click on it to edit, there you will only see the $(inherited).

Of more importance, however, is the section under that says Header Search Paths. If you click on it you should see a bunch of options that look something like: "${PODS_ROOT}/Headers/Public/NameOfPod" so I would again make sure Google is included in that list. If you open your project in the finder (right click on the Pods and click show in Finder) you also should be able to explicitly navigate to the header files by going through Pods > Headers > Public).

This is most likely where things are going wrong and there's an existing question on stack overflow you can find here that might give you some other suggestions for what to do.

Not entirely positive if this is recommended but if you find the location of the header you're trying to import, you could try explicitly adding it to the "User Header Search Paths" that is in the bottom of the Search Paths options you're looking at.

My suggestion to you however if you find anything weird about this is to remove and reinstall Cocoapods since this should be taken care of for you by them. And by that I mean completely de-integrating Cocoapods

like image 196
gadu Avatar answered Oct 23 '22 01:10

gadu