11

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.

Vvk
  • 4,031
  • 29
  • 51
Mohsin Qureshi
  • 151
  • 1
  • 1
  • 6

5 Answers5

16

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.

  1. In Xcode, go to Preferences... > Locations, then click on the Advanced... button.
  2. Make sure the build location radio button is set to "Unique".
  3. Close out the Preferences and Rebuild.
eb1
  • 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
  • Well, that was a red herring for me. – Kheldar Oct 28 '15 at 09:57
  • 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
  • I would give you 5 starts not one for this. Thanks – Jorj Dec 15 '15 at 11:39
  • 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
12

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+.

enter image description here

Vvk
  • 4,031
  • 29
  • 51
3

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.

rmc47
  • 1,364
  • 1
  • 13
  • 17
0

You may need to update your CordovaLib sub-project reference.

  1. Launch Terminal.app
  2. 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
  3. 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

KennyC
  • 921
  • 7
  • 16
-2
"$(BUILT_PRODUCTS_DIR)" "$(OBJROOT)/UninstalledProducts/include" "$(TARGET_BUILD_DIR)/usr/local/lib/include"

phonegap add podfile must include above

Gank
  • 4,507
  • 4
  • 49
  • 45