仍然在 xcode 中获取 <Cord​​ova/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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 03:21:46  来源:igfitidea点击:

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

xcodecordovaphonegap-plugins

提问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。

  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.
  1. 在 Xcode 中,转到 Preferences... > Locations,然后单击 Advanced... 按钮。
  2. 确保构建位置单选按钮设置为“唯一”。
  3. 关闭首选项并重建。

回答by Vvk

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

它适用于Xcode 7.0 + 和 iOS 9+

enter image description here

在此处输入图片说明

回答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 子项目参考。

  1. Launch Terminal.app
  2. Go to the location where you installed Cordova in the binsub-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

  1. 启动 Terminal.app
  2. 转到您在bin子文件夹中安装 Cordova 的位置。例如,/Users/Shared/Cordova/phonegap-2.2.0/lib/ios/bin
  3. 运行下面的脚本,其中第一个参数是项目的 .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 必须包含在上面