'Cordova/CDVViewController.h' file not found when run in Xcode terminal

耗尽温柔 提交于 2019-12-05 05:44:58
maridob

I've spent too much time figuring out the solution for this so it is a shame not to share. There can be many possible reasons why this problem arise but if you feel like you've set up everything right in the CordovaLib (like me!) and still has the same problem. This can be one of the causes. What's happening is when I ran the

 xcodebuild  -scheme myProject -configuration "Release"

it is building successfully, but if you don't supply "-scheme" it it will fail by default it is using the "Release". The parameters of the scheme will control which targets are built and how they are built, myProject scheme contains the subfolder and reference to Cordovalib.

Now, moving to Jenkins, is you need to supply the scheme in the "Xcode Schema File" text box in the Advanced Xcode build options section of the XCode Plugin.

My set-up is Xcode as my slave but this may still apply to whatever Xcode and Jenkins combination you have - so when I ran the

 xcodebuild  -list

I receive the message the following message:

If no build configuration is specified and -scheme is not passed then "Release" is used.

This project contains no schemes.

The solution for this is, in your xcode project, go to Product|Scheme|Manage Scheme and checked "Shared" to both projects myProject and CordovaLib. Compile. Check-in (because I am grabbing this from TFS). Ran again the "-list" command and you will see the schemes that you just shared.

Hope this helps!

Thanks a lot ! Just adding "-scheme" and "-configuration" parameters fixed the problem for me.

If it can help someone else, here is the full command line i used :

xcodebuild -scheme MyProject -configuration "Release" -arch i386 -sdk iphonesimulator7.1

I used it to generate a ios simulator build in order to submit an Phonegap / Cordova application to the Facebook Review

Rita

In build settings add this item to "Header Search Path"

$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!