still getting <Cordova/CDVViewController.h> file not found error in xcode

旧城冷巷雨未停 提交于 2019-12-18 19:19:45

问题


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.


回答1:


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.



回答2:


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




回答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.




回答4:


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




回答5:


"$(BUILT_PRODUCTS_DIR)" "$(OBJROOT)/UninstalledProducts/include" "$(TARGET_BUILD_DIR)/usr/local/lib/include"

phonegap add podfile must include above



来源:https://stackoverflow.com/questions/16445556/still-getting-cordova-cdvviewcontroller-h-file-not-found-error-in-xcode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!