I install an Objective C pod to my swift 3 project. I include “use_frameworks” in the Podfile so I don’t need to add anything to my bridging header.
The problem is when I include a (third party) generated ObjectiveC file that attempts to #import a header from the pod - it fails with “‘[xxxxx].h’ file not found”
The ObjectiveC #import "GTLRObject.h" statement causes "GTLRObject.h file not found" error.
My Podfile:
target 'myHelloWorld' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
pod 'GoogleAPIClientForREST'
end
Bridging header. I need to include the header for the generated ObjectiveC class so I can use it in my swift code :
#import "GTLREcho.h"
GTLREcho.h:
// NOTE: This file was generated by the ServiceGenerator.
// ----------------------------------------------------------------------------
// API:
// echo/v1
// Description:
// This is an API
#import "GTLREchoObjects.h"
#import "GTLREchoQuery.h"
#import "GTLREchoService.h"
Error is in GTLREchoObjects.h. #import "GTLRObject.h" = "'GTLRObject.h' file not found":
#if GTLR_BUILT_AS_FRAMEWORK
#import "GTLR/GTLRObject.h"
#else
#import "GTLRObject.h"
#endif
If I try and reference GTLRObject from a swift file I don't get any error e.g.
import Foundation
import GoogleAPIClientForREST
class ControllerHello: NSObject {
func sayHello(strTest: String){
let gtlObject = GTLRObject
}
}
Any advice appreciated.
Since this answer might be useful for others.
When using GoogleAPIClientForREST
:
Open TARGETS
> App
> Build Settings
For User Header Search Paths
add Pods
and select recursive
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With