PhoneGap Xcode在Build 'Cordova/CDVViewController上丢失了头文件。h的文件未找到

时间:2023-01-13 20:23:35

I am using PhoneGap 2.2.0 and XCode 4.5.2.

我正在使用PhoneGap 2.2.0和XCode 4.5.2。

I can test my programs in the simulators, and I can put them on my devices to test them.

我可以在模拟器中测试我的程序,我可以把它们放在我的设备上测试它们。

But I simply cannot build for distribution. It always fails with the following error:

但我无法为分配而构建。它总是以以下错误失败:

my-projevt-path/Classes/AppDelegate.h:30:9: 'Cordova/CDVViewController.h' file not found

my-projevt-path /类/ AppDelegate。h:30:9:'科尔多瓦/ CDVViewController。h的文件未找到

I've seen this problem around the web and still can't make it work, given whatever solutions have been posted.

我在网上看到过这个问题,但不管发布了什么解决方案,我还是不能解决它。

I've changed things in Build Settings, I've reinstalled PhoneGap, I've run new lines in terminal, I've done my app over starting a new PhoneGap project from scratch, I've checked preferences in the build location in Xcode... I can't figure this out AT ALL.

我在构建设置中做了更改,我重新安装了PhoneGap,在终端中运行了新行,我在从头开始一个新的PhoneGap项目时做了应用,我在Xcode中检查了构建位置的首选项……我完全搞不懂。

Please, can anyone help? I've been working on this for days.

拜托,谁能帮忙吗?这事我已经做了好几天了。

Thanks!

谢谢!

5 个解决方案

#1


1  

Problems in Xcode

在Xcode中问题

If you have compilation problems related to missing headers, the build products should build into the same build directory. You may need to set the preference "Xcode Preferences -> Locations -> Derived Data -> Advanced…" to "Unique". This is the default setting for Xcode on a fresh new install, if you upgraded from older versions of Xcode, you might have a legacy preference in there that you need to update.

如果您有与丢失头有关的编译问题,那么构建产品应该构建到相同的构建目录中。您可能需要将首选项“Xcode首选项—>位置—>派生数据—>高级……”设置为“Unique”。这是新安装上的Xcode的默认设置,如果您从旧版本的Xcode进行升级,您可能会有需要更新的遗留首选项。

Found the answer!!!

找到了答案! ! !

#2


1  

The answer, in my case, had seemingly nothing to do with the error message that was being sent. Missing header files? That didn't seem to be the issue. Or, at least, not the direct cause of the issue.

在我的例子中,答案似乎与正在发送的错误消息无关。缺少头文件?这似乎不是问题所在。或者,至少不是问题的直接原因。

This was an issue with my provisioning/certificates being somehow not right. I had re-created them several times, but it continued to be an issue.

这是我的配置/证书不正确的问题。我已经重新创作了好几次,但它仍然是一个问题。

I sent the job to another developer, who opened it on his machine, revoked my certificates and created new ones, and built it without changing anything else. He forwarded me the certificate, the provisioning, and an archive of the job. I opened the archive in xCode and validated it and uploaded it. And it was fine.

我把工作发给了另一个开发人员,后者在他的机器上打开了它,撤销了我的证书,创建了新的证书,并在不更改任何其他内容的情况下构建了它。他向我提供了证书、配置和工作存档。我在xCode中打开归档文件并对其进行验证并上传。,感觉不错。

If you have got this problem, be certain your certificate/provisioning is set up right. I thought mine was, but apparently it wasn't? The "Apple Process" is definitely weird, and when certificates / profiles gets messed up, problems arise.

如果您遇到了这个问题,请确保您的证书/配置设置正确。我以为是我的,但显然不是?“苹果流程”肯定很奇怪,当证书/配置文件混乱时,问题就出现了。

#3


0  

Yes I am getting the same problem yeah and some help could be great..... I followed all the instructions even with the ./update_cordova_subproject path as well it does not work. Also I solved the locking problem but I could not find the solution to this problem

是的,我也遇到了同样的问题是的,有一些帮助是很好的……即使使用了./update_cordova_subproject路径,我也遵循了所有的指示。我也解决了锁问题,但是我找不到这个问题的解决方案

#4


0  

I was having the same problem and just solved it! First of the problem may very well be because of your distribution provisioning files... but when you look at the Project Navigator in xCode at the top level you have your Project and inside you have the CordovaLib.xcodeproj click on this file and you will see the iOS Deployment target. Make sure the proper IOS version is selected there. This is 1/2.

我也遇到了同样的问题,而且刚刚解决了!第一个问题很可能是由于您的发行版准备文件……但是当你在xCode中查看项目导航器时你有你的项目,在里面你有CordovaLib。单击此文件,您将看到iOS部署目标。确保选择了正确的IOS版本。这是1/2。

2) Then you need to duplicate the Release configuration and rename it Distribution. While the CordovaLib.xcodeproj is selected make a build and then build the actual project. This worked smoothly for me.

2)然后您需要复制发布配置并将其重命名为发行版。而CordovaLib。选择xcodeproj进行构建,然后构建实际的项目。这对我来说很顺利。

#5


0  

Add this line to your Build Settings -> Header Search Paths:

将这一行添加到您的构建设置中——>头搜索路径:

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

Don't replace the existing line that looks similar, that is still needed to be backwards compatible with Xcode 7 and Xcode 6.4.

不要替换看起来类似的现有行,这仍然需要向后兼容Xcode 7和Xcode 6.4。

#1


1  

Problems in Xcode

在Xcode中问题

If you have compilation problems related to missing headers, the build products should build into the same build directory. You may need to set the preference "Xcode Preferences -> Locations -> Derived Data -> Advanced…" to "Unique". This is the default setting for Xcode on a fresh new install, if you upgraded from older versions of Xcode, you might have a legacy preference in there that you need to update.

如果您有与丢失头有关的编译问题,那么构建产品应该构建到相同的构建目录中。您可能需要将首选项“Xcode首选项—>位置—>派生数据—>高级……”设置为“Unique”。这是新安装上的Xcode的默认设置,如果您从旧版本的Xcode进行升级,您可能会有需要更新的遗留首选项。

Found the answer!!!

找到了答案! ! !

#2


1  

The answer, in my case, had seemingly nothing to do with the error message that was being sent. Missing header files? That didn't seem to be the issue. Or, at least, not the direct cause of the issue.

在我的例子中,答案似乎与正在发送的错误消息无关。缺少头文件?这似乎不是问题所在。或者,至少不是问题的直接原因。

This was an issue with my provisioning/certificates being somehow not right. I had re-created them several times, but it continued to be an issue.

这是我的配置/证书不正确的问题。我已经重新创作了好几次,但它仍然是一个问题。

I sent the job to another developer, who opened it on his machine, revoked my certificates and created new ones, and built it without changing anything else. He forwarded me the certificate, the provisioning, and an archive of the job. I opened the archive in xCode and validated it and uploaded it. And it was fine.

我把工作发给了另一个开发人员,后者在他的机器上打开了它,撤销了我的证书,创建了新的证书,并在不更改任何其他内容的情况下构建了它。他向我提供了证书、配置和工作存档。我在xCode中打开归档文件并对其进行验证并上传。,感觉不错。

If you have got this problem, be certain your certificate/provisioning is set up right. I thought mine was, but apparently it wasn't? The "Apple Process" is definitely weird, and when certificates / profiles gets messed up, problems arise.

如果您遇到了这个问题,请确保您的证书/配置设置正确。我以为是我的,但显然不是?“苹果流程”肯定很奇怪,当证书/配置文件混乱时,问题就出现了。

#3


0  

Yes I am getting the same problem yeah and some help could be great..... I followed all the instructions even with the ./update_cordova_subproject path as well it does not work. Also I solved the locking problem but I could not find the solution to this problem

是的,我也遇到了同样的问题是的,有一些帮助是很好的……即使使用了./update_cordova_subproject路径,我也遵循了所有的指示。我也解决了锁问题,但是我找不到这个问题的解决方案

#4


0  

I was having the same problem and just solved it! First of the problem may very well be because of your distribution provisioning files... but when you look at the Project Navigator in xCode at the top level you have your Project and inside you have the CordovaLib.xcodeproj click on this file and you will see the iOS Deployment target. Make sure the proper IOS version is selected there. This is 1/2.

我也遇到了同样的问题,而且刚刚解决了!第一个问题很可能是由于您的发行版准备文件……但是当你在xCode中查看项目导航器时你有你的项目,在里面你有CordovaLib。单击此文件,您将看到iOS部署目标。确保选择了正确的IOS版本。这是1/2。

2) Then you need to duplicate the Release configuration and rename it Distribution. While the CordovaLib.xcodeproj is selected make a build and then build the actual project. This worked smoothly for me.

2)然后您需要复制发布配置并将其重命名为发行版。而CordovaLib。选择xcodeproj进行构建,然后构建实际的项目。这对我来说很顺利。

#5


0  

Add this line to your Build Settings -> Header Search Paths:

将这一行添加到您的构建设置中——>头搜索路径:

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

Don't replace the existing line that looks similar, that is still needed to be backwards compatible with Xcode 7 and Xcode 6.4.

不要替换看起来类似的现有行,这仍然需要向后兼容Xcode 7和Xcode 6.4。