Xcode 创建通用 Xcode 存档而不是 iOS App Archive? [英] Xcode creating generic Xcode archive instead of iOS App Archive?

查看:26
本文介绍了Xcode 创建通用 Xcode 存档而不是 iOS App Archive?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将我的应用上传到应用商店连接,但我无法验证我的应用.我还看到标识符和其他信息没有显示出来.这是为什么?这是个问题吗?如果我可以更改,如何更改?[![在此处输入图片描述][1]][1]

我已经尝试了在 [here][2] 中找到的那些投票 2+ 的东西.

Incase 相关:我正在使用一个带有 cocoapods 的项目

info.plist 的 XML:

 <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><字典><key>ArchiveVersion</key><整数>2</整数><key>CreationDate</key><日期>2019-09-01T20:47:53Z</日期><key>名称</key><string>FinalAppPrj</string><key>SchemeName</key><string>FinalAppPrj</string></dict></plist>

[![在此处输入图片描述][3]][3]

解决方案

这是为什么?

这通常发生在 xCode 无法创建用于分发的有效存档时,因此它只会在管理器的其他项目"中创建为通用 Xcode 存档".

<块引用>

有问题吗?

是的,因为您将无法将其提交到 Apple Store Connect.您不能打包通用档案,也不能提交它们以供审核.

<块引用>

如果我可以改变这个,如何改变?

首先,我们需要检查项目设置:

  • 在<代码>目标>中管理方案... 检查您当前的目标是否是选择了 Shared 标志的有效项目

  • 在<代码>目标>中编辑方案... 检查目标是否是唯一启用存档的目标.还要检查分析和存档选项卡是否在构建配置中选择了发布

  • 在<代码>产品>中分析(Shift + command + B),检查是否有错误.您可以在导航器面板上的最后一个图标中访问报告:

我检查了

2) 您的存档包含静态库或框架.

在这种情况下,库和框架需要将标志 skip install 设置为 YES

然后尝试再次存档.

如果所有解决方案都不起作用,则

然后关闭并重新打开 xCode.在 Window >组织者,如果存档在 iOS 应用程序下,那么您可以验证和分发应用程序.

编辑

要添加iOS分发证书,在xCode中,点击xCode >首选项 >Accounts > 选择团队并点击 Manage Certificates... .在 Plus 按钮 上,您应该会看到 iOS Distribution:

将此证书添加到项目中,检查钥匙串是否添加到那里并将其指向.plist文件.

当您使用签名团队时,您还需要将该团队添加到 .plist.我用所需的条目更新了 .plist 文件.

I'm trying to upload my app to app store connect and I am unable to validate my app. I also see that identifier and other info is not showing up. Why is this? Is it a problem? If I can change this, how? [![enter image description here][1]][1]

I have tried the things found in [here][2] that where voted 2+.

Incase its relevant: I am using a project with cocoapods

XML for info.plist:

    <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>ArchiveVersion</key>
    <integer>2</integer>
    <key>CreationDate</key>
    <date>2019-09-01T20:47:53Z</date>
    <key>Name</key>
    <string>FinalAppPrj</string>
    <key>SchemeName</key>
    <string>FinalAppPrj</string>
</dict>
</plist>

[![enter image description here][3]][3]

解决方案

Why is this?

This usually happens when xCode can't create a valid archive for distribution, so it just gets created in "Other Items" in the Organizer as a "Generic Xcode Archive".

Is it a problem?

Yes, because you will not be able to submit it to Apple Store Connect. You cannot package generic archives nor submit them for review.

If I can change this, how?

First of all, we need to check the project setup:

  • In Target > Manage Schemes... check if your current target is a valid project with the Shared flag selected

  • In Target > Edit Scheme... check if the target is the only one with Archive enabled. Also check if the Analyze and the Archive tabs have Release selected in Build Configuration

  • In Product > Analyze (Shift + command + B), check if there are no errors. You can access the report in the last icon on the navigator panel:

I checked all the 2 vote answers on this link, and they mostly cover all the possible solutions, but I would like to double check the Apple's support page troubleshoot:

1) Your archive contains header files.

If you are using a static library, check if there is a Headers build phase. If so, delete this phase, add a Copy Files build phase to your library, and use it to export your header files.

2) Your archive contains static libraries or frameworks.

In this case, the libraries and frameworks need to have the flag skip install set to YES

Then try to archive it again.

If none of the solutions worked, there is a workaround here that consists in modifying the archive .plist file manually and adding the missing information. It can be accessed:

  • Archive your project
  • Organizer will show a Generic Xcode Archive
  • Right Click, Show in finder
  • Right Click, Show Package Contents
  • Open the Info.plist file in a XML editor

Your valid .plist file would be like this:

Just replace PASTE_YOUR_BUNDLE_IDENTIFIER_HERE with your bundle identifier, PASTE_YOUR_CERTIFICATE_NAME_HERE with your certificate name,PASTE_YOUR_CERTIFICATE_ID_HERE with your certificate id and PASTE_YOUR_TEAM_ID_HERE with your team id.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>ApplicationProperties</key>
    <dict>
        <key>ApplicationPath</key>
        <string>Applications/FinalAppPrj.app</string>
        <key>CFBundleIdentifier</key>
        <string>PASTE_YOUR_BUNDLE_IDENTIFIER_HERE</string>
        <key>CFBundleShortVersionString</key>
        <string>1.0</string>
        <key>CFBundleVersion</key>
        <string>1</string>
        <key>SigningIdentity</key>
        <string>iPhone Distribution: PASTE_YOUR_CERTIFICATE_NAME_HERE (PASTE_YOUR_CERTIFICATE_ID_HERE)</string>
        <key>Team</key>
        <string>PASTE_YOUR_TEAM_ID_HERE</string>
    </dict>
    <key>ArchiveVersion</key>
    <integer>2</integer>
    <key>CreationDate</key>
    <date>2019-09-01T20:47:53Z</date>
    <key>Name</key>
    <string>FinalAppPrj</string>
    <key>SchemeName</key>
    <string>FinalAppPrj</string>
</dict>
</plist>

To check the certificate name and ID, the easiest way is to open Keychain Access.app (Mac Finder > Applications > Utilities > Keychain Access.app), find the certificate (you can filter by the text "Distribution") and see its details. Marked in green is the name, marked in red is the ID between parenthesis.

Then close and reopen xCode. In Window > Organizer, if the archive is under iOS Apps, then you can Validate and Distribute the app.

Edit

To add an iOS Distribution Certificate, in xCode, click on xCode > Preferences > Accounts > Select the team and click on Manage Certificates... . On the Plus button you should see iOS Distribution:

Add this certificate to the project, check in the keychain if is added there and point it into the .plist file.

As you are using a signing team, you also need to add the team to the .plist. I updated the .plist file with the needed entry.

这篇关于Xcode 创建通用 Xcode 存档而不是 iOS App Archive?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆