Post Xcode 7.1 Upgrade build issue – cordova/CDVViewController.h file not found

If you have recently upgraded your Xcode to 7.1 version, you will start getting cordova/CDVViewController.h file not founderror. You would be surprised that earlier build was working perfectly fine with Xcode 6.4 and Xcode 7.0

Screen Shot 2015-11-26 at 15.43.18

Screen Shot 2015-11-26 at 15.43.24

To fix this error follow these steps:

In Xcode select the project and go to Build Settings of the project and the Search for Header Search Path It will show you below shown screen.

Screen Shot 2015-11-26 at 15.48.09

Double click on the Multiple values row and it will show you a list pop-up now add a new row to this list and add content

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

Then archive/build the app and you will see everything works fine.

If you want to add this content from command line instead of directly adding it using XCODE IDE, then use command:

xcodebuild HEADER_SEARCH_PATHS="\$(TARGET_BUILD_DIR)/usr/local/lib/include \$(OBJROOT)/UninstalledProducts/include \$(BUILT_PRODUCTS_DIR) \$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include"

NOTE

Reason behind this issue is, release of new platforms like tvOS, there is an extra folder has been created to archive intermediates, namely a folder with the name of the os. earlier we had "$(OBJROOT)/UninstalledProducts/include" and now we should have "$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include" To make xcode 7.1 work we should have these both paths added to `HEADERSEARCHPATHS

Advertisements

3 thoughts on “Post Xcode 7.1 Upgrade build issue – cordova/CDVViewController.h file not found

Add yours

  1. Thanks for writing.
    Facing same issue on Xcode Version 7.1 (7B91b).

    I Tried:
    Adding header search path as mentioned.
    Changing import statements from to “” .
    Changing Preferences –> Location –> Advance to unique.

    I am using:
    Cordova Platform: 6.3.1
    Cordova android 5.2.2
    Cordova ios 4.2.1

    ERROR:

    In file included from /Users/myProject/phonegap/platforms/ios/Phonegap/Classes/MainViewController.m:28:
    /Users/myProject/phonegap/platforms/ios/Phonegap/Classes/MainViewController.h:28:9: fatal error: ‘Cordova/CDVViewController.h’ file not found
    #import “Cordova/CDVViewController.h”
    ^
    In file included from /Users/myProject/phonegap/platforms/ios/Phonegap/Classes/AppDelegate.m:28:
    /Users/myProject/phonegap/platforms/ios/Phonegap/Classes/AppDelegate.h:28:9: fatal error: ‘Cordova/CDVViewController.h’ file not found
    #import “Cordova/CDVViewController.h”
    ^
    1 error generated.

    /Users/myProject/phonegap/platforms/ios/Phonegap/Plugins/cordova-plugin-device/CDVDevice.m:24:9: fatal error: ‘Cordova/CDV.h’ file not found
    #import “Cordova/CDV.h”
    ^

    not sure what I am missing. Help is much appreciated.

  2. This does not work with Xcode 8. You have to reinstall latest version of cordova, and remove platform and add it again

    npm un cordova
    sudo npm install -g cordova // yarn global add cordova

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a website or blog at WordPress.com

Up ↑

%d bloggers like this: