Skip to content
This repository was archived by the owner on Dec 15, 2021. It is now read-only.
This repository was archived by the owner on Dec 15, 2021. It is now read-only.

'GTLDefines.h' file not found #182

@eliotstock

Description

@eliotstock

Repro steps:

  • Start an iOS project with Podfile:
platform :ios, '9.3.1' use_frameworks! pod 'GoogleAPIClient', '~> 1.0.2' pod 'GTMOAuth2', '~> 1.1.0' 
  • Write an API for Google Cloud Endpoints and build it to get a discovery file out.
  • Clone this repo and build the ServiceGenerator tool from it, then run that tool on the discovery doc to generate Objective-C sources for the client to your cloud endpoints API.
CURRENT_DIR=`pwd` REPO_DIR="google-api-objectivec-client-temp" # Clone the Google API client library from git. Using --recursive gets the stuff in Deps too. git clone --recursive https://github.com/google/google-api-objectivec-client.git ${REPO_DIR} # Build the ServiceGenerator binary cd ${REPO_DIR}/Source/Tools/ServiceGenerator/ xcodebuild -project ServiceGenerator.xcodeproj -alltargets -configuration Release build # Run the ServiceGenerator on our discovery doc cd ${CURRENT_DIR} ${REPO_DIR}/Source/Tools/ServiceGenerator/build/Release/ServiceGenerator ./foo-v1-rpc.discovery --outputDir ./foo-ios-client # Clean up rm -rf ${REPO_DIR} 
  • Add GTLFoo.h and GTLFoo_Sources.m to your project in XCode, where Foo is the name of your API.
  • In your bridging header file, import your API header:

#import "GTLFoo.h"

  • Build. You'll get build errors (Foo below is now Api):
/Users/Eliot/dev/biketracker/biketracker-ios/BikeTracker/BikeTracker-Bridging-Header.h:20:9: note: in file included from /Users/Eliot/dev/biketracker/biketracker-ios/BikeTracker/BikeTracker-Bridging-Header.h:20: #import "GTLApi.h" ^ /Users/Eliot/dev/biketracker/biketracker-ios/biketracker-ios-client/GTLApi.h:16:9: note: in file included from /Users/Eliot/dev/biketracker/biketracker-ios/biketracker-ios-client/GTLApi.h:16: #import "GTLApiConstants.h" ^ /Users/Eliot/dev/biketracker/biketracker-ios/biketracker-ios-client/GTLApiConstants.h:21:11: error: 'GTLDefines.h' file not found #import "GTLDefines.h" ^ <unknown>:0: error: failed to import bridging header '/Users/Eliot/dev/biketracker/biketracker-ios/BikeTracker/BikeTracker-Bridging-Header.h' 

GTLDefines.h is in the Pod, at Pods/GoogleAPIClient/Source/GTLDefines.h. Why can't XCode see it?

Build Settings -> Header Search Paths contains "$(inherited)".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions