Search code examples
iosxcodeapp-storexcode7restkit

Cannot archive an iOS 5.0 era project with RestKit v0.10.3 using Xcode 7.2


I have got an old iOS project which is of iOS 5.0 era. I need to archive it using latest iOS SDK and submit it to App Store.

It consists of an .pbxproj main project which uses RestKit as sub-subproject. Cocoapods is not being used at that era and RestKit is being included as git submodule.

Under Xcode 7.2, it builds and runs perfectly fine, but when it comes to archive, it keeps prompting error message like this:

#import <RestKit/RestKit.h> fails

I have already search RestKit's old documentation and tried using the suggested method, but still not working for me.

I wonder if the Header Search Paths is set wrongly in build settings, it is set as "$(BUILT_PRODUCTS_DIR)/../../Headers" originally.

P.S. I do not wish to upgrade the RestKit version. Minimum support iOS version should be iOS 7.


Solution

  • I finally managed to fix my problem by setting Header Search Paths of targets in all xcodeprojs (along the chain, including the parent and child) in Release build configuration. I have set the value to "${BUILT_PRODUCTS_DIR}/../../IntermediateBuildFilesPath/Headers". I found that the RestKit header files are being copied to IntermediateBuildFilesPath/Headers during the archive phase.