Xcode 8在iOS 9.2及以下版本上崩溃 [英] Xcode 8 build crash on iOS 9.2 and below

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

问题描述

当我用Xcode 8 GM Seed构建我的应用程序并运行它在iOS 9.2下面的设备或模拟器,我会在应用程序启动或应用程序启动后几秒钟奇怪的EXC_BAD_ACCESS崩溃。崩溃总是发生在不同的地方(添加一个子视图, [UIImage imageNamed:] ,应用程序委托的主要方法等)。当我在iOS 9.3+或10上运行时,我不会得到那些崩溃,当我使用Xcode 7 构建时不会得到它们,并且在iOS 9.2及以下版本上运行。有没有人体验类似的东西?这是Xcode 8的已知问题吗?

解决方案

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



您可以保存16位资产作为8位的与Preview.app


如何解决错误ITMS-90682:无效的捆绑 - 资产目录
Payload / XXXXX / Assets.car不能包含16位或P3资源,如果
应用程序支持iOS 8或更早版本。



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


  1. 创建Inspectable .ipa文件。在Xcode Organizer(Xcode-> Window-> Organizer)中,选择要检查的归档,单击
    导出...,然后选择导出为企业或特定部署
    将为您的应用程序创建.ipa文件的本地副本。


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


  3. 展开.zip文件,将生成包含您的.app文件夹的Payload文件夹。


  4. 打开终端并将工作目录更改为.app捆绑包的顶层cd路径/到/ Payload / your.app


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


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


  7. 检查生成的/tmp/Assets.json并查找包含DisplayGamut:P3其关联的名称。这将
    是包含一个或多个16位或P3
    资源的图片集的名称。


  8. 将这些资产替换为8 -bit / sRGB assets,然后重新构建您的应用程序。


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



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?

解决方案

See the accepted answer https://forums.developer.apple.com/thread/60919

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

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."

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. 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.

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

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

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

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

  6. 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

  7. 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. Replace those assets with 8-bit / sRGB assets, then rebuild your app.

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天全站免登陆