Cordova 应用程序无法使用 Xcode 7.3 存档(未找到 Cordova/CDVViewController.h 文件)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/36546001/
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 08:42:57  来源:igfitidea点击:

Cordova app failing to Archive with Xcode 7.3 (Cordova/CDVViewController.h' file not found)

xcodecordovaipa

提问by msk

I have a project with Cordova(6.1.1)/Phonegap(5.3.10). I am trying to build an ipa file with Xcode 7.3. When I click on Product > Archive the build fails, and the log says: 'Cordova/CDVViewController.h' file not found. I can successfully build the project to a device, so i am kinda lost knowing what the problem might be.

我有一个 Cordova(6.1.1)/Phonegap(5.3.10) 的项目。我正在尝试使用 Xcode 7.3 构建一个 ipa 文件。当我单击“产品”>“存档”时,构建失败,日志显示:找不到“Cordova/CDVViewController.h”文件。我可以成功地将项目构建到设备上,所以我有点不知道可能是什么问题。

I have tried to change the Header Search Path from

我试图将标题搜索路径从

"$(OBJROOT)/UninstalledProducts/include"

"$(OBJROOT)/UninstalledProducts/include"

to

"$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include"

"$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include"

from reading this post Xcode 7.2: In “Archive”: Getting the issue: “Cordova/CDVViewController.h' file not found ”. While there is no such issues in building the app

从阅读这篇文章 Xcode 7.2: In “Archive”: Getting the issue: “Cordova/CDVViewController.h' file not found”。虽然在构建应用程序时没有这样的问题

I have tried to change chage to enable bitcode to "no", but still no luck at Archiving my app.

我试图更改 chage 以启用位码为“否”,但在归档我的应用程序时仍然没有运气。

From many readings here on stackoverflow the issue seems to be with header search path, but this havent solved my issue. Dont know if there is something else on Xcode 7.3, because the other posts is with Xcode 7.2 and below. Dont know how to solve this issue, has anyone else experienced this problem?

从stackoverflow上的许多阅读资料来看,问题似乎与标题搜索路径有关,但这并没有解决我的问题。不知道 Xcode 7.3 上是否还有其他内容,因为其他帖子是 Xcode 7.2 及以下版本。不知道如何解决这个问题,有没有其他人遇到过这个问题?

Update (Solution):

更新(解决方案):

Under Build Settings > Deployment > Install owner. I left that blank and then it finally worked.

在构建设置 > 部署 > 安装所有者下。我把那个空白留了下来,然后它终于奏效了。

回答by Gandhi

Try this out, this should work.

试试这个,这应该有效。

  • Run this in your terminal: cordova platform update ios

  • Open your project in Xcode

  • Go to Preference -> Locations -> Advanced

  • Choose "Unique" as the option for Build Location

  • Product -> Clean

  • Product -> Build

  • 在您的终端中运行:cordova platform update ios

  • 在 Xcode 中打开您的项目

  • 转到首选项 -> 位置 -> 高级

  • 选择“唯一”作为构建位置的选项

  • 产品 -> 清洁

  • 产品 -> 构建

Try out cordova platform update iosas well as it fixed the problem for the questioner

尝试cordova platform update ios并解决提问者的问题

回答by joemalski

If you have tried all the suggestions above and still it does not work. You can try these:

First check if you have this folder "CordovaLib", under: platforms->ios

Second, make sure you have the icons and splash images in your "resources" folder.

if not:

$ ionic resources

then run:

ionic platform remove ios
ionic platform add ios

如果您已经尝试了上述所有建议,但仍然无效。你可以试试这些:

首先检查你是否有这个文件夹“CordovaLib”,在:platforms->ios

其次,确保你的“resources”文件夹中有图标和启动图像。

如果不是:

$ ionic resources

然后运行:

ionic platform remove ios
ionic platform add ios

These commands will install "CordovaLib" folder, then do the build again.

这些命令将安装“CordovaLib”文件夹,然后再次进行构建。

回答by alacret

This does not work with Xcode 8. You have to reinstall latest version of cordova, and remove platform and add it again

这不适用于 Xcode 8。您必须重新安装最新版本的cordova,并删除平台并重新添加

npm un cordova
sudo npm install -g cordova // yarn global add cordova