I am new in PhoneGap, making a app via Xcode; But I found an error regarding CDVViewController.h
. However, the file physically exists there. I am using Xcode 4.6 and Cordova 2.2.0.

- 4,031
- 29
- 51

- 151
- 1
- 1
- 6
-
1"X-Code"? And you still there? Pfff... – May 08 '13 at 16:25
-
@H2CO3 It's better than I-pad, right? – Undo May 08 '13 at 16:30
-
1@Undo Let's say I can't decide which one is worse. – May 08 '13 at 16:33
-
What is the exact error you get? – Undo May 08 '13 at 17:44
-
http://stackoverflow.com/questions/12184767/phonegap-cdvviewcontroller-h-file-not-found-when-archiving-for-ios/12596916#12596916 – Allan Aug 26 '15 at 10:06
5 Answers
Man, there are a lot of red herring answers to this question out there. This is what worked for me, and is in the documentation for both PhoneGap 2.5 and 3.0 (see here: PhoneGap docs for iOS (look under "missing headers"), using Xcode 4.6.
- In Xcode, go to Preferences... > Locations, then click on the Advanced... button.
- Make sure the build location radio button is set to "Unique".
- Close out the Preferences and Rebuild.

- 2,897
- 3
- 31
- 42
-
This one worked for me, after having tried a ton of alternatives. – Pekka Nikander Oct 07 '14 at 18:36
-
-
In all seriousness, though - this is still a common configuration problem and is still listed up on the iOS platform guide as of Oct 2015. I run into it periodically when I switch between mobile (iOS) and desktop development and forget to change the build locations. – eb1 Oct 28 '15 at 20:46
-
-
Wow - an hour trying the other solutions. This one did it. XCode version 7.3.1 - Cordova version 6.2.0 Thank you so much! – Alex C Aug 31 '16 at 15:27
Please add this line to your projects Build Settings >> Header Search Paths:
$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include
it's worked on Xcode 7.0 + and iOS 9+.

- 4,031
- 29
- 51
-
1Thanx :-) This happen due the latest upgrade to iOS9 (and the latest xCode update) – Gil Epshtain Nov 11 '15 at 15:46
-
If you're building to the local build output directory, rather than the new xcode artefact store, you may need to copy the contents of CordovaLib/build into $YOURPROJECT/build.
The same applies if you're using xcodebuild from a terminal.

- 1,364
- 1
- 13
- 17
You may need to update your CordovaLib sub-project reference.
- Launch Terminal.app
- Go to the location where you installed Cordova in the bin sub-folder. For example, /Users/Shared/Cordova/phonegap-2.2.0/lib/ios/bin
Run the script below where the first parameter is the path to your project's .xcodeproj file:
./update_cordova_subproject path/to/your/project/xcodeproj

- 921
- 7
- 16
"$(BUILT_PRODUCTS_DIR)" "$(OBJROOT)/UninstalledProducts/include" "$(TARGET_BUILD_DIR)/usr/local/lib/include"
phonegap add podfile must include above

- 4,507
- 4
- 49
- 45