在 Xcode 中存档不会产生任何存档

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

Archiving in Xcode produces no archives

iphoneiosxcodeipad

提问by Andrew Johnson

I tried to build my app both for adhoc distribution and release, and either way, the archives don't show up in Organizer. The build succeeds and the app and dsym file show up as expected, but no archives - Organizer says "No Archives."

我尝试为临时分发和发布构建我的应用程序,无论哪种方式,档案都不会显示在 Organizer 中。构建成功,应用程序和 dsym 文件按预期显示,但没有存档 - 组织者说“没有存档”。

Other notes:

其他注意事项:

1) I don't think it's related to the SKIP_INSTALL property in Settings. I had that issue months ago, and corrected it. I also went through my Build Settings and verified SKIP_INSTALL was set to No for the static libraries again, just to be sure - Archive does not appear in xcode4 organizer

1)我认为它与设置中的 SKIP_INSTALL 属性无关。几个月前我遇到了这个问题,并纠正了它。我还检查了我的构建设置并验证了静态库的 SKIP_INSTALL 再次设置为否,只是为了确定 -存档不会出现在 xcode4 管理器中

2) I can build debug and run the app just fine.

2)我可以很好地构建调试并运行应用程序。

3) I build apps from several user accounts on this iMac, and the other user accounts generate archives OK, for other apps.

3) 我在这台 iMac 上从多个用户帐户构建应用程序,其他用户帐户为其他应用程序生成存档。

I have tried searching, but I am stuck. I was wondering if I should try reinstalling Xcode.

我试过搜索,但我被卡住了。我想知道我是否应该尝试重新安装 Xcode。

回答by jmstone617

I had this same issue and none of the solutions you've already tried helped me either. I found this answer Archives not showing up in Organizer for XCode 4which had the fix for me.

我遇到了同样的问题,您已经尝试过的解决方案都没有帮助我。我发现这个答案档案没有出现在 XCode 4 的管理器中,它为我提供了修复。

In short, my Installation Directory under the Deployment section in my Build Settings was blank. I set it to "/Applications" and was able to see my archives again.

简而言之,我的构建设置中部署部分下的安装目录是空白的。我将它设置为“/Applications”并且能够再次看到我的档案。

That being said, I am working on another project where this field is blank and I am having no issues. It could be that XCode just barfed and needed this field changed to SOMETHING and that I could have just as easily changed it back from /Applications to a blank value. Or, alternatively, setting the blank value in my current project to "/Applications" could keep things working fine. But, if it ain't broke...And in the former case, it wasbroke, and changing this field worked for me.

话虽如此,我正在另一个项目中,该字段为空白,我没有遇到任何问题。可能是 XCode 刚刚出现并需要将此字段更改为 SOMETHING,而我可以轻松地将其从 /Applications 更改回空白值。或者,将当前项目中的空白值设置为“/Applications”可以让事情正常工作。但是,如果它不破...在前者的情况下,它破产了,而改变这一领域的工作对我来说。

回答by sergio

You did not mention that you checked the default location where Xcode stores the archives. You could double-check it under Xcode > Preferences ... > Locations.

您没有提到您检查了 Xcode 存储档案的默认位置。您可以在 Xcode > Preferences ... > Locations 下仔细检查它。

If that does not help, I would try renaming the directories related to Xcode under the account where Xcode is not archiving correctly. I.e.:

如果这没有帮助,我会尝试在 Xcode 未正确归档的帐户下重命名与 Xcode 相关的目录。IE:

~/Library/Application Support/Developer ~/Library/Application Support/Xcode ~/Library/Developer

~/Library/Application Support/Developer ~/Library/Application Support/Xcode ~/Library/Developer

I would also suggest to copy the project that Xcode is not archiving over to a different account and trying to archive it from there. That would help pinning down if the problem is project-related or account-related.

我还建议将 Xcode 未存档的项目复制到其他帐户并尝试从那里存档。这将有助于确定问题是与项目相关还是与帐户相关。

Hope this helps.

希望这可以帮助。

回答by Andy Obusek

Why not use command line as an alternative? Try this script, even if command line alone doesn't suit your needs, maybe it will shed some light on what's wrong? See if you can create a valid ipa file with this script (you'll need to populate the variables with paths specific to your system):

为什么不使用命令行作为替代方案?试试这个脚本,即使单独的命令行不适合您的需求,也许它会揭示出什么问题?看看您是否可以使用此脚本创建有效的 ipa 文件(您需要使用特定于您的系统的路径填充变量):

cd "${PROJDIR}"
xcodebuild -target "${PROJECT_NAME}" -sdk "${TARGET_SDK}" -configuration Release
if [ $? != 0 ]
then
  exit 1
fi
/usr/bin/xcrun -sdk iphoneos PackageApplication -v "${PROJECT_BUILDDIR}/${APPLICATION_NAME}.app" -o "${BUILD_HISTORY_DIR}/${APPLICATION_NAME}.ipa"

回答by William Myers

This problem happened to me in Xcode 7.1. while archiving an iOS Ionic Cordova app.

这个问题在 Xcode 7.1 中发生在我身上。在归档 iOS Ionic Cordova 应用程序时。

My problem was caused by not having the correct Scheme selected. There were two schemes available under Product > Scheme, one was my-app-name and the other was 'CordovaLib' which was selected and caused empty archives to be created with sweet FA appearing in the Organizer (and no error messages or anything).

我的问题是由于没有选择正确的方案引起的。在“产品”>“方案”下有两种方案可用,一种是 my-app-name,另一种是“CordovaLib”,它被选中并导致创建空档案,管理器中出现甜蜜 FA(并且没有错误消息或任何内容)。

To actually change the scheme to my-app-name I had to do it from the weirdly designed dropdown on the top left of Xcode main interface. It's not possible to change it from the Product > Scheme menu even though it looks like you can.

要将方案实际更改为 my-app-name,我必须从 Xcode 主界面左上角设计怪异的下拉菜单中进行操作。即使看起来可以,也无法从“产品”>“方案”菜单更改它。

Once I changed the scheme my archives started working and appearing in the Organizer.

一旦我改变了方案,我的档案就开始工作并出现在组织者中。

This link has further info: https://developer.apple.com/library/ios/technotes/tn2215/_index.html#//apple_ref/doc/uid/DTS40011221-CH1-XCODE_SUCCESSFULLY_ARCHIVED_MY_APPLICATION__BUT_THE_ARCHIVES_ORGANIZER_DOES_NOT_LIST_MY_ARCHIVE

此链接有更多信息:https: //developer.apple.com/library/ios/technotes/tn2215/_index.html#//apple_ref/doc/uid/DTS40011221-CH1-XCODE_SUCCESSFULLY_ARCHIVED_MY_APPLICATION__BUT_THE_ARCHIVES_ORGANIZER_MY

回答by Pet

I solved this problem as follows navigate to Build Settings->Compilation Modechange in Release row Whole Module to Incrementallink to the screenshot

我解决了这个问题,如下导航到Build Settings-> Compilation Modechange in Release row Whole Module to Incremental链接到屏幕截图

回答by Trianna Brannon

This was happening to me and my solution was to completely exit xcode reopen and try the archive again, totally fixed. Must be a bug of some sort.

这发生在我身上,我的解决方案是完全退出 xcode 重新打开并再次尝试存档,完全修复。一定是某种错误。

回答by Shyam K

  1. Select the build target as 'iOS Device'.
  2. Select Product->Archive from the menu toolbar.
  3. Click 'Next' and then select the file location.
  4. Select '.ipa' and click 'Next'.
  5. Select the location at which you would like to save the file. Click OK.
  6. The file appears at the location selected above.
  1. 选择构建目标为“iOS 设备”。
  2. 从菜单工具栏中选择产品->存档。
  3. 单击“下一步”,然后选择文件位置。
  4. 选择“.ipa”并单击“下一步”。
  5. 选择要保存文件的位置。单击确定。
  6. 该文件出现在上面选择的位置。

But, to build on an iOS Device you must have the proper certificates installed and appropriate changes made under the Target heading.

但是,要在 iOS 设备上构建,您必须安装正确的证书并在目标标题下进行适当的更改。

回答by Carles Estevadeordal

The problem you describe has ever happened to me but, in my opinion the solution should be found in the Edit Scheme option of the Product menu, there you can find the Archive section and its configuration.

您描述的问题曾经发生在我身上,但我认为应该在产品菜单的编辑方案选项中找到解决方案,在那里您可以找到存档部分及其配置。

Check the option Reveal Archive in Organizer, the Build configuration, etc...

检查在管理器中显示存档选项、构建配置等...

I hope that this may help you...

我希望这可以帮助你...

回答by Abizern

Make sure that you are building a scheme that uses a Build Configuration that uses a Distribution certificate, and also that you aren't building for the Simulator but for the device (you don't have to have one plugged in, but you need to choose that as the destination).

确保您正在构建一个使用使用分发证书的构建配置的方案,并且您不是为模拟器而是为设备构建(您不必插入一个,但您需要选择它作为目的地)。

Then, go to the Product menu and choose Archive.

然后,转到“产品”菜单并选择“存档”。