且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Xcode 8 在 iOS 9.2 及更低版本上构建崩溃

更新时间:2023-12-04 13:44:40

查看接受的答案 https://forums.developer.apple.com/thread/60919

您可以使用 Preview.app 将 16 位资源保存为 8 位资源

You can save 16-bit assets as 8-bit ones with Preview.app

如何解决错误 ITMS-90682:无效的捆绑包 - 资产目录在Payload/XXXXX/Assets.car"中,如果应用支持 iOS 8 或更早版本."

How to resolve "ERROR ITMS-90682: Invalid Bundle - The asset catalog at 'Payload/XXXXX/Assets.car' can't contain 16-bit or P3 assets if the app supports iOS 8 or earlier."

使用 Xcode 8 GM,如果您包含 16 位或 P3,则会出现此错误应用程序提交中针对 iOS 版本早于 iOS 的资产9.3.如果您的应用需要广色域功能,您必须将部署目标更改为 iOS 9.3 或更高版本.如果您的应用没有需要广泛的颜色功能,并且您希望将其部署到较旧的iOS 版本,那么您应该将所有 16 位或 P3 资产替换为8 位 sRGB 资源.您可以通过运行找到 16 位或 P3 资产错误消息中命名的资产目录上的assetutil"来自iTunes 连接.以下步骤概述了该过程:

With Xcode 8 GM, this error will occur if you include 16-bit or P3 assets in an app submission targeting iOS releases earlier then iOS 9.3. If your app requires wide color functionality you must change your Deployment Target to iOS 9.3 or later. If your app does not require wide color functionality and you wish to deploy it to older iOS versions then you should replace all 16-bit or P3 assets with 8-bit sRGB assets. You can find 16-bit or P3 assets by running "assetutil" on the asset catalog named in the error message from iTunes Connect. The following steps outline the process:

  1. 创建一个可检查的 .ipa 文件.在 Xcode Organizer (Xcode->Window->Organizer) 中,选择要检查的存档,单击Export...",然后选择Export for Enterprise or Ad-Hoc Deployment".这将为您的应用创建 .ipa 文件的本地副本.

  1. Create an Inspectable .ipa file. In the Xcode Organizer (Xcode->Window->Organizer), select an archive to inspect, click "Export...", and choose "Export for Enterprise or Ad-Hoc Deployment". This will create a local copy of the .ipa file for your app.

找到该 .ipa 文件并将其扩展名更改为 .zip.

Locate that .ipa file and change its the extension to .zip.

展开 .zip 文件.这将生成一个包含您的 .app 包的 Payload 文件夹.

Expand the .zip file. This will produce a Payload folder containing your .app bundle.

打开终端并将工作目录更改为 .app 包的顶层 cd path/to/Payload/your.app

Open a terminal and change the working directory to the top level of your .app bundle cd path/to/Payload/your.app

使用查找工具在您的 .app 包中查找 Assets.car 文件,如下所示:-name 'Assets.car'

Use the find tool to locate Assets.car files in your .app bundle as shown below: find . -name 'Assets.car'

使用assetutil 工具在您的应用程序具有的每个Assets.car 中查找任何16 位或P3 资产,如下所示.: sudo xcrun --sdk iphoneosassetutil --info/path/to/a/Assets.car >/tmp/Assets.json

Use the assetutil tool to find any 16-bit or P3 assets, in each Assets.car your application has as shown below. : sudo xcrun --sdk iphoneos assetutil --info /path/to/a/Assets.car > /tmp/Assets.json

检查生成的/tmp/Assets.json 并查找包含DisplayGamut"的任何内容:P3"及其关联的名称".这会是包含一个或多个 16 位或 P3 的图像集的名称资产.

Examine the resulting /tmp/Assets.json and look for any contents containing "DisplayGamut": "P3" and its associated "Name". This will be the name of your imageset containing one or more 16-bit or P3 assets.

将这些资源替换为 8 位/sRGB 资源,然后重新构建您的应用.

Replace those assets with 8-bit / sRGB assets, then rebuild your app.

更新:如果您的部署目标设置为 8.3 或 8.4,并且您有资产目录,那么您将收到同样的错误消息,即使您没有实际上有 16 位或 P3 资产.在这种情况下,您要么需要降低您的部署目标到 8.2,或将其移至 9.x.

Update: If your Deployment Target is set to either 8.3 or 8.4 and you have an asset catalog then you will receive this same error message, even if you do not actually have 16-bit or P3 assets. In this case you will either need to lower your Deployment Target to 8.2, or move it up to 9.x.