仍然在 xcode 中获取 <Cordova/CDVViewController.h> 文件未找到错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16445556/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
still getting <Cordova/CDVViewController.h> file not found error in xcode
提问by Mohsin Qureshi
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.
我是 PhoneGap 的新手,通过 Xcode 制作应用程序;但是我发现了一个关于CDVViewController.h
. 但是,该文件实际存在于那里。我使用的是 Xcode 4.6 和 Cordova 2.2.0。
回答by eb1
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.
伙计,有很多关于这个问题的红鲱鱼答案。这对我有用,并且在 PhoneGap 2.5 和 3.0 的文档中(请参阅此处:iOS 的 PhoneGap 文档(在“缺少的标题”下查看),使用 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.
- 在 Xcode 中,转到 Preferences... > Locations,然后单击 Advanced... 按钮。
- 确保构建位置单选按钮设置为“唯一”。
- 关闭首选项并重建。
回答by Vvk
回答by rmc47
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.
如果您正在构建到本地构建输出目录,而不是新的 xcode 工件存储,您可能需要将 CordovaLib/build 的内容复制到 $YOURPROJECT/build 中。
The same applies if you're using xcodebuild from a terminal.
如果您从终端使用 xcodebuild,这同样适用。
回答by KennyC
You may need to update your CordovaLib sub-project reference.
您可能需要更新 CordovaLib 子项目参考。
- Launch Terminal.app
- Go to the location where you installed Cordova in the binsub-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
- 启动 Terminal.app
- 转到您在bin子文件夹中安装 Cordova 的位置。例如,/Users/Shared/Cordova/phonegap-2.2.0/lib/ios/bin
运行下面的脚本,其中第一个参数是项目的 .xcodeproj 文件的路径:
./update_cordova_subproject path/to/your/project/xcodeproj
回答by Gank
"$(BUILT_PRODUCTS_DIR)" "$(OBJROOT)/UninstalledProducts/include" "$(TARGET_BUILD_DIR)/usr/local/lib/include"
phonegap add podfile must include above
phonegap add podfile 必须包含在上面