Xcode 7不会从在Xcode 6中构建有效存档的同一项目中构建有效的存档

时间:2023-01-25 11:39:29

When using Xcode 7b5 to build my app that contains a Today Extension I cannot create a valid archive. When I make an archive the build succeeds and then in Organizer it shows up under "Other Items" instead of under "iOS Apps".

当使用Xcode 7b5构建包含Today Extension的应用程序时,我无法创建有效的存档。当我进行存档时,构建成功,然后在管理器中它显示在“其他项目”下而不是“iOS应用程序”下。

If I close the project and open up the same project in Xcode 6.3.2 when I make the archive it shows up under "iOS Apps".

如果我关闭项目并在Xcode 6.3.2中打开相同的项目,当我进行存档时,它会显示在“iOS Apps”下。

I compared the archives and the one thing I noticed is that my Today Widget is being placed outside of the Applications directory. The structure looks like this for Xcode 6.3.2 vs Xcode 7b5:

我比较了档案,我注意到的一件事是我的今日小部件被放置在Applications目录之外。对于Xcode 6.3.2和Xcode 7b5,结构如下所示:

Xcode 6.3.2
|-Archive
|--Products
|---Applications
|----MyMainApp.app

Xcode 6.3.2 | -Archive | - 产品| ---应用程序| ---- MyMainApp.app

Xcode 7 Beta 5
|-Archive
|--Products
|---Applications
|----MyMainApp.app
|---MyTodayWidget.appex

Xcode 7 Beta 5 | -Archive | - 产品| ---应用程序| ---- MyMainApp.app | --- MyTodayWidget.appex

I think the problem is that the MyTodayWidget is packaged outside of the Applications dir and outside of the .app. I'm not sure why Xcode 7 beta 5 would package the app differently than Xcode 6.3.2 when I didn't make any changes.

我认为问题是MyTodayWidget打包在Applications目录之外和.app之外。我不确定为什么Xcode 7 beta 5会以不同于Xcode 6.3.2的方式打包应用程序,而我没有做任何更改。

UPDATE 8/14/2015: This appears to be an issue with CocoaPods and Extensions like a WatchKit or Today extension. It has been reported as Invalid archive produced when using "Archive" in Xcode 7 beta 5 (with watchkit extension) #4021 by another developer. It appears to be the root cause of this issue.

更新2015年8月14日:这似乎是CocoaPods和Extensions的一个问题,如WatchKit或Today扩展。据报道,其他开发人员在Xcode 7 beta 5(带有watchkit扩展名)#4021中使用“Archive”时产生了无效存档。这似乎是这个问题的根本原因。

Environment:
- Xcode 7 Beta 5
- Today Extension
- Normal App
- CocoaPods 0.38.2 (Latest Released Version as of 9/22)
- AFNetworking Used in Extension & App

环境: - Xcode 7 Beta 5 - 今日扩展 - 普通应用程序 - CocoaPods 0.38.2(截至9月22日的最新发布版本) - AFNetworking用于扩展和应用程序

7 个解决方案

#1


16  

It's an issue with CocoaPods v0.39.0.beta.4.

这是CocoaPods v0.39.0.beta.4的一个问题。

As described in CocoaPods GitHub the beta 3 of CocoaPods allows you to build archives as expected. Beta 4 has a bug preventing this from working.

正如CocoaPods GitHub中所描述的,CocoaPods的beta 3允许您按预期构建存档。 Beta 4有一个错误阻止它工作。

Uninstall your previous CocoaPods version first

首先卸载以前的CocoaPods版本

sudo gem uninstall cocoapods

sudo gem uninstall cocoapods

and then do:

然后做:

sudo gem install cocoapods -v 0.39.0.beta.3 --verbose

sudo gem install cocoapods -v 0.39.0.beta.3 --verbose

then

pod update

and you'll be able to build archives again as expected.

并且您将能够按预期再次构建存档。

#2


12  

I just confirmed today that this was a CocoaPods issue for me, specifically 4021. I tried as the other users on the issue and removed "copy pod resources" from my today extension target. Once that was removed I was able to package up an archive successfully in Xcode 7 Beta 5.

我今天刚刚确认这对我来说是一个CocoaPods问题,特别是4021.我在问题上尝试了其他用户并从我今天的扩展目标中删除了“复制pod资源”。删除后,我能够在Xcode 7 Beta 5中成功打包存档。

Hopefully this still works in the next beta and the GM...

希望这仍然适用于下一个测试版和GM ...

UPDATE 9/22: This is the answer if you are using 0.38.2 of CocoaPods their latest Release version as of 9/22/2015. I was able to submit my app to the app store using Xcode 7 GM using this method.

更新9月22日:如果您在2015年9月22日之前使用0.38.2 CocoaPods的最新发布版本,这将是您的答案。我可以使用此方法使用Xcode 7 GM将我的应用程序提交到应用程序商店。

#3


3  

Finally it`s fixed in the latest stable Version 0.39.0:

最后它修复了最新的稳定版本0.39.0:

So instead of uninstalling

所以而不是卸载

sudo gem uninstall cocoapods

and reinstalling via

并重新安装通过

sudo gem install cocoapods

Also a simple

也很简单

sudo gem update cocoapods

should fix it!

应该解决它!

#4


1  

I had the same issue when updated Xcode to Version 7.0 (7A220). And they said this issue is already tracked(Issue#4274)

将Xcode更新为7.0版(7A220)时,我遇到了同样的问题。他们说已经跟踪了这个问题(问题#4274)

finally,i fixed this issue with following steps: 1)clear all "Private Headers Folder Path" and "Public Headers Folder Path" in all the Pods Targets->Build Setting->Packaging 2)delete the "Copy Pods Resources" in our Targets->Build Phases.

最后,我通过以下步骤解决了这个问题:1)在所有Pods目标 - >构建设置 - >打包2中清除所有“私有标题文件夹路径”和“公共标题文件夹路径”)删除我们的“复制窗口资源”目标 - >构建阶段。

#5


0  

This can be caused by using CocoaPods 0.38.[0-2] and Xcode 7.

这可能是由于使用CocoaPods 0.38。[0-2]和Xcode 7引起的。

It works with an older version of CocoaPods:

它适用于较旧版本的CocoaPods:

$ gem install cocoapods -v "=0.37.2"
$ gem uninstall cocoapods # then select 0.38.[0-2]
$ pod update

(Additionally, I also had to clean my build folder and wipe the Pods folder before the pod update and make changes to the AFNetworing post install hook in my Podfile)

(另外,我还必须清理我的构建文件夹并在pod更新之前擦除Pods文件夹,并在我的Podfile中更改AFNetworing post安装钩子)

Further causes are discussed in Cannot generate iOS App archive in xcode.

在xcode中无法生成iOS App存档中讨论了其他原因。

#6


0  

Works fine if you delete Copy Pod Resources from your extension. Though I have no idea what this could cause, my app worked, archived and went to review.

如果从扩展中删除Copy Pod Resources,则可以正常工作。虽然我不知道这可能导致什么,我的应用程序工作,存档并进行审查。

#7


0  

If using Xcode 7 with cocoapods v.0.38.2. Try removing copy pod resources from your today extension target.

如果将Xcode 7与cocoapods v.0.38.2一起使用。尝试从今天的扩展目标中删除复制pod资源。

#1


16  

It's an issue with CocoaPods v0.39.0.beta.4.

这是CocoaPods v0.39.0.beta.4的一个问题。

As described in CocoaPods GitHub the beta 3 of CocoaPods allows you to build archives as expected. Beta 4 has a bug preventing this from working.

正如CocoaPods GitHub中所描述的,CocoaPods的beta 3允许您按预期构建存档。 Beta 4有一个错误阻止它工作。

Uninstall your previous CocoaPods version first

首先卸载以前的CocoaPods版本

sudo gem uninstall cocoapods

sudo gem uninstall cocoapods

and then do:

然后做:

sudo gem install cocoapods -v 0.39.0.beta.3 --verbose

sudo gem install cocoapods -v 0.39.0.beta.3 --verbose

then

pod update

and you'll be able to build archives again as expected.

并且您将能够按预期再次构建存档。

#2


12  

I just confirmed today that this was a CocoaPods issue for me, specifically 4021. I tried as the other users on the issue and removed "copy pod resources" from my today extension target. Once that was removed I was able to package up an archive successfully in Xcode 7 Beta 5.

我今天刚刚确认这对我来说是一个CocoaPods问题,特别是4021.我在问题上尝试了其他用户并从我今天的扩展目标中删除了“复制pod资源”。删除后,我能够在Xcode 7 Beta 5中成功打包存档。

Hopefully this still works in the next beta and the GM...

希望这仍然适用于下一个测试版和GM ...

UPDATE 9/22: This is the answer if you are using 0.38.2 of CocoaPods their latest Release version as of 9/22/2015. I was able to submit my app to the app store using Xcode 7 GM using this method.

更新9月22日:如果您在2015年9月22日之前使用0.38.2 CocoaPods的最新发布版本,这将是您的答案。我可以使用此方法使用Xcode 7 GM将我的应用程序提交到应用程序商店。

#3


3  

Finally it`s fixed in the latest stable Version 0.39.0:

最后它修复了最新的稳定版本0.39.0:

So instead of uninstalling

所以而不是卸载

sudo gem uninstall cocoapods

and reinstalling via

并重新安装通过

sudo gem install cocoapods

Also a simple

也很简单

sudo gem update cocoapods

should fix it!

应该解决它!

#4


1  

I had the same issue when updated Xcode to Version 7.0 (7A220). And they said this issue is already tracked(Issue#4274)

将Xcode更新为7.0版(7A220)时,我遇到了同样的问题。他们说已经跟踪了这个问题(问题#4274)

finally,i fixed this issue with following steps: 1)clear all "Private Headers Folder Path" and "Public Headers Folder Path" in all the Pods Targets->Build Setting->Packaging 2)delete the "Copy Pods Resources" in our Targets->Build Phases.

最后,我通过以下步骤解决了这个问题:1)在所有Pods目标 - >构建设置 - >打包2中清除所有“私有标题文件夹路径”和“公共标题文件夹路径”)删除我们的“复制窗口资源”目标 - >构建阶段。

#5


0  

This can be caused by using CocoaPods 0.38.[0-2] and Xcode 7.

这可能是由于使用CocoaPods 0.38。[0-2]和Xcode 7引起的。

It works with an older version of CocoaPods:

它适用于较旧版本的CocoaPods:

$ gem install cocoapods -v "=0.37.2"
$ gem uninstall cocoapods # then select 0.38.[0-2]
$ pod update

(Additionally, I also had to clean my build folder and wipe the Pods folder before the pod update and make changes to the AFNetworing post install hook in my Podfile)

(另外,我还必须清理我的构建文件夹并在pod更新之前擦除Pods文件夹,并在我的Podfile中更改AFNetworing post安装钩子)

Further causes are discussed in Cannot generate iOS App archive in xcode.

在xcode中无法生成iOS App存档中讨论了其他原因。

#6


0  

Works fine if you delete Copy Pod Resources from your extension. Though I have no idea what this could cause, my app worked, archived and went to review.

如果从扩展中删除Copy Pod Resources,则可以正常工作。虽然我不知道这可能导致什么,我的应用程序工作,存档并进行审查。

#7


0  

If using Xcode 7 with cocoapods v.0.38.2. Try removing copy pod resources from your today extension target.

如果将Xcode 7与cocoapods v.0.38.2一起使用。尝试从今天的扩展目标中删除复制pod资源。