15

I've recently updated my Xcode to version 7.1 (from 7.0.1) and my Cordova app is failing to Archive with the error that says:

'Cordova/CDVViewController.h' file not found

in MainViewController.h file.

Searching through solutions on StackOverflow and elsewhere suggests that setting the project's Header Search Path from "$(OBJROOT)/UninstalledProducts/include"to "$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include" seems to solve the issue for a lot of people. However, this did not resolve the issue for me.

Is there anything that could be amiss? I never encountered a problem like this prior to updating Xcode.

Associated screenshot: Notice the Header Search Paths for both Debug and Release

UPDATE: It seems like updating my Mac OS X to El Capitan might have fixed this problem as I no longer get it. At the time of posting this question, I was on Yosemite. Hope this helps anyone encountering the same issue

GoldenD
  • 475
  • 1
  • 5
  • 10

5 Answers5

34

This is the solution!

Add this line to your Build Settings -> Header Search Paths:

"$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include"
Franc
  • 424
  • 3
  • 3
21

This is a problem with 7.1 check out this thread which may help (on the ionic forums but isn't an ionic specific issue, it's Cordova with XCode 7.1) http://forum.ionicframework.com/t/cordova-cdvviewcontroller-h-file-not-found-in-xcode-7-1-beta/32232

Simon Prickett
  • 3,838
  • 1
  • 13
  • 26
  • The link is suggesting what I've already tried, which is to update the Header Search Paths (as mentioned in the question). This did not work for me. My Cordova installation is already at version 5.3.3 as well. Still wondering what could be wrong. Thanks anyway. – GoldenD Oct 27 '15 at 23:30
  • 2
    The link has worked for me, it says "Add this line to your Build Settings -> Header Search Paths: "$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include" Don't replace the existing line that looks similar" – standup75 Oct 28 '15 at 14:17
  • Adding this line to the END of the Release entry for Header Search Paths worked for me – jcaruso Oct 28 '15 at 16:12
  • 2
    Solution is always more appreciated than a link to it. – Jari Keinänen Oct 30 '15 at 07:25
  • Thanks for saving my life :D – PrimaryChicken Dec 03 '15 at 09:46
  • Excellent. Good to note that you are keeping the old header path too! Just adding the new one as well! – Chris Jan 04 '16 at 00:28
10

I found a solution on this thread which worked for me with Xcode 7.1 (I was still having problems on OS X El Capitan).

Gandhi's answer is:

  • Run this in your terminal: cordova platform update ios
  • Open your project in Xcode
  • Go to Preference -> Locations -> Advanced
  • Choose "Unique" as the option for Build Location
  • Product -> Clean
  • Product -> Build
Community
  • 1
  • 1
wumbo
  • 746
  • 9
  • 21
7

I found this solution at http://forum.ionicframework.com/t/cordova-cdvviewcontroller-h-file-not-found-in-xcode-7-1-beta/32232:

Add this line to your Build Settings -> Header Search Paths:

"$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include"

Don't replace the existing line that looks similar, that is still needed to be backwards compatible with Xcode 7 and Xcode 6.4.

but doesn't work for old Cordova versions. I cannot upgrade to recent version of Cordova, so after a little try&search approach I found a new solution that seem works on my environment:

"$(OBJROOT)/UninstalledProducts/$(CONFIGURATION)-$(PLATFORM_NAME)/include"

Same advice as before, don't replace the existing line, but append the new role at the end.

Hope this should be useful.

Community
  • 1
  • 1
druid
  • 91
  • 5
2

On the screenshot I see a whitespace on "build/UninstalledProducts/iphoneos/include ", try removing it.

And you don't have to remove the old, "$(OBJROOT)/UninstalledProducts/include", you have to keep both

jcesarmobile
  • 51,328
  • 11
  • 132
  • 176