0

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.

user3002689
  • 51
  • 1
  • 1
  • 3
  • I ended up doing `#import "RKObjectManager.h"` style imports for each RestKit class I depend on rather than the whole bundle. You can also try `@import RestKit;` to import the framework. – Eric Hedstrom Jan 14 '17 at 17:39
  • 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 Jan 14 '17 at 19:59
  • 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 Jan 14 '17 at 20:22
  • 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 Jan 15 '17 at 18:51

1 Answers1

0

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.

user3002689
  • 51
  • 1
  • 1
  • 3