3

I am trying to use Jenkins-CI to auto-build an iOS project that uses Restkit, apparently, restkit resides as a project inside the main project. And the project builds successfully using the XCode-IDE.

But when i use xcodebuild(jenkins uses it, and i did simulate the same) to build the project it gives the

error RestKit/RestKit.h file not found

Any clue whats going wrong, can this be corrected by using scheme file? If so how? or can I simulate, how XCode-IDE deals with this?

egghese
  • 2,193
  • 16
  • 26
  • Have you looked at https://github.com/RestKit/RestKit/wiki/Installing-RestKit-in-Xcode-4.x ? – Michaël Nov 16 '12 at 12:52
  • @malinois It tells how to integrate RestKit into XCode Project, we done it correctly and XCode is building the project, the issue comes with the command line tool xcodebuild. It says it cannot find Restkit headers. – egghese Nov 16 '12 at 12:57
  • Do you mean your main project builds without errors? If not then you probably missed out setting target dependency on other project. See this http://stackoverflow.com/questions/5986586/xcode-4-how-to-add-static-library-target-dependency-to-project to set target dependency. – Rahul Wakade Nov 16 '12 at 13:02
  • @Rahul, sorry if am not clear with my question. This is more of a dependency issue that arises only during `xcodebuild` which is a command line tool. Things work good in the GUI environment. – egghese Nov 19 '12 at 05:45

3 Answers3

2

I don't think am answering this question, but a proper workaround this would be making use of XCode Schemes. Also one should mark the particular scheme as Shared.

These links can serve helpful

http://tetontech.wordpress.com/2011/05/26/command-line-building-using-xcode/

http://developer.apple.com/library/ios/#recipes/xcode_help-scheme_editor/Articles/SchemeManage.html

egghese
  • 2,193
  • 16
  • 26
1

I have exactly same problem. My solution:

firstly you have build RestKit. After than, you can build your project.

If you run script from you project's top directory and restkit is in RestKit folder:

xcodebuild -project RestKit/RestKit.xcodeproj -target RestKit -sdk iphonesimulator -configuration Debug clean build

Then you can build you project.

If this isn't enought, add to "Header search paths" this two :

"$(BUILT_PRODUCTS_DIR)/../../RestKit/Build/Headers"
"$(BUILT_PRODUCTS_DIR)/../../Headers/RestKit"

And beware, you have to add this to all targets

kraag22
  • 3,340
  • 3
  • 29
  • 37
  • Sounds promising, I will update/accept your answer once I get this done on the project. – egghese Dec 01 '12 at 08:33
  • @Jesly Varghese: did you get this work for you? I am experiencing the same problem, just with another testing static library I built following instructions at http://developer.apple.com/library/ios/technotes/iOSStaticLibraries/iOSStaticLibraries.pdf. Everything builds fine in XCode, but not with xcodebuild, the import statement give error, saying file not found. – xueru Feb 07 '13 at 13:06
  • 1
    @xueru I never got it working for the CI Server am working for, well i didn't get time pursuing and solving this issue. But if you just want xcodebuild to work the statically included library in same way as it works for XCode, then consider compiling with scheme. Let me know how if you have tried it. I will consider exploring further options. – egghese Feb 09 '13 at 08:02
0

I guess your problem is the same as "Xcodebuild'ing a workspace and setting a custom build path". Set the SYSROOT with absolute path, default is relative path.

Community
  • 1
  • 1
SFeng
  • 2,226
  • 1
  • 19
  • 16