'Cordova/CDVViewController.h' file not fou

2019-04-26 17:08发布

So when I am trying to build my code from xcode terminal it is failing and giving me an error of 'Cordova/CDVViewController.h' file not found but when I am building this from xcode then it is building just fine.

In my Xcode, I've done the whole Cordova sub directory thing Upgrade Cordova. Also when I ran list. This is what I see below:

xcodebuild -list

Information about project "myProject":

Targets:
    myProject

Build Configurations:
    Debug
    Release

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

Schemes:
    myProject
    CordovaLib

Environment: Xcode5, OS 10.8.5

Is there anything I am missing? The reason why I am doing this because I am trying to run this through jenkins. I thought it was a jenkins issue but then I got it down to the xcode terminal not seeing the CordovaLib.

3条回答
【Aperson】
2楼-- · 2019-04-26 17:41

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

查看更多
Anthone
3楼-- · 2019-04-26 17:50

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!

查看更多
孤傲高冷的网名
4楼-- · 2019-04-26 17:50

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

$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include
查看更多
登录 后发表回答