Xcode 8 在 iOS 9.2 及更低版本上构建崩溃 [英] Xcode 8 build crash on iOS 9.2 and below

查看:40
本文介绍了Xcode 8 在 iOS 9.2 及更低版本上构建崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用 Xcode 8 GM Seed 构建我的应用程序并在低于设备或模拟器的 iOS 9.2 上运行它时,我在应用程序启动期间或应用程序启动几秒钟后遇到奇怪的 EXC_BAD_ACCESS 崩溃.崩溃总是发生在不同的地方(添加子视图、[UIImage imageNamed:]、应用程序委托的主要方法等).当我在 iOS 9.3+ 或 10 上运行它时,我不会遇到这些崩溃,而当我使用 Xcode 7 build 并在 iOS 9.2 及更低版本上运行时,我也不会遇到这些崩溃.有没有其他人经历过类似的事情?这是 Xcode 8 的一个已知问题吗?

When I build my app with Xcode 8 GM Seed and run it on an iOS 9.2 below device OR simulator, I get strange EXC_BAD_ACCESS crashes during app startup or a few seconds after the app launched. The crash always happens in a different spot (adding a subview, [UIImage imageNamed:], app delegate's main method etc). I don't get those crashes when I run it on iOS 9.3+ or 10 and I don't get them when I build with Xcode 7 and run on iOS 9.2 and below. Has anyone else experiences something similar? Is this a known issue with Xcode 8?

推荐答案

查看接受的答案 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.

这篇关于Xcode 8 在 iOS 9.2 及更低版本上构建崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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