0
votes

I'm using Xcode 8.2.1 with CocoaPods 1.1.1. I've got a iOS application using RestKit 0.27, with Objective-C and Swift 3 code. Everything builds and works flawlessly in simulator and on the device, but the project won't compile when archiving it for distribution:

/Users/***/MyProject-Bridging-Header.h:16:9: note: in file included from /Users/***/MyProject-Bridging-Header.h:16:
#import "CustomRKObjectRequestOperation.h"
        ^
/Users/***/Services/CustomRKObjectRequestOperation.h:10:9: error: 'RestKit/RestKit.h' file not found
#import <RestKit/RestKit.h>
        ^
<unknown>:0: error: failed to import bridging header '/***/MyProject-Bridging-Header.h'

I found a similar issue here: https://forums.developer.apple.com/message/79355#79355, but suggested fix doesn't work, probably because it's for Xcode 7.1.

1
I ended up doing #import "RKObjectManager.h" style imports for each RestKit class I depend on rather than the whole <RestKit/RestKit.h> bundle. You can also try @import RestKit; to import the framework. - Eric Hedstrom
I removed all references to RestKit from the Swift part of the project (bridging header also) and the archiving fails on the very first non-Apple framework that is referenced: import Foundation import SwiftyJSON import Moya import Alamofire breaks with "No such module 'SwiftyJSON'", breaks with "No such module 'Moya'" if I put Moya as second. - user3002689
I edited the run scheme to use Release configuration, the project doesn't build now. It seems the things referenced in pods don't are not available when built in Release. - user3002689
Check your project's and build target's Xcode build settings to see what's different between your Debug and Release configurations. In particular check HEADER_SEARCH_PATHS. - Eric Hedstrom

1 Answers

0
votes

It turns out FRAMEWORK_SEARCH_PATHS in Release configuration did not have any references to any of the Pods frameworks. Everything is working fine now, nothing to do with RestKit.