Xcode 8 error on iOS 9.2 and below

When I create my application with Xcode 8 GM Seed and run it on iOS 9.2 below the device OR simulator, I get strange EXC_BAD_ACCESS crashes when the application starts or a few seconds after the application starts. A crash always occurs elsewhere (adding the main subview method, [UIImage imageNamed:] , the main application delegate, etc.). I don’t get these 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 lower. Does anyone else experience something similar? Is this a known issue with Xcode 8?

+79
ios xcode8 crash
Sep 09 '16 at 5:15
source share
8 answers

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

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

How to solve "ERROR ITMS-90682: Invalid package - Asset catalog in the section" Payload /XXXXX/Assets.car "cannot contain 16-bit or P3 assets if the application supports iOS 8 or earlier.

With Xcode 8 GM, this error will occur if you enable 16-bit or P3 assets in the application view aimed at releases of iOS earlier than iOS 9.3. If your application requires wide color functionality, you must change your deployment target level to iOS 9.3 or later. If your application does not require wide color functionality, and you want to deploy it on iOS, then you must replace all 16-bit or P3 assets with 8-bit sRGB assets. You can find 16-bit or P3 assets by running "assetutil" in the asset directory indicated in the error message from iTunes Connect. The following steps describe the process:

  • Create the Inspectable.ipa file. In the Xcode organizer (Xcode-> Window-> Organizer), select the archive to check, click "Export ..." and select "Export for corporate or temporary deployment." This will create a local copy of the .ipa file for your application.

  • Find this .ipa file and change its extension to .zip.

  • Expand the .zip file. This will create a Payload folder containing your .app package.

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

  • Use the search tool to find the Assets.car files in your .app package, as shown below: find. -name 'Assets.car'

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

  • Examine the resulting /tmp/Assets.json and find any content that contains "DisplayGamut": "P3" and the associated "Name". This will be the name of your image containing one or more 16-bit or P3 assets.

  • Replace these assets with 8-bit / sRGB resources, and then rebuild your application.

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

+49
Sep 12 '16 at 15:25
source share

I hope this bash script can help you. The input argument is the directory that contains all the xcassets of your project. This script will set the sRGB profile for all png. It helped me:)

 #!/bin/bash DIRECTORY=$1 echo "------------------------------" echo "Passed Resources with xcassets folder argument is <$DIRECTORY>" echo "------------------------------" echo "Processing asset:" XSAASSETSD="$(find "$DIRECTORY" -name '*.xcassets')" for xcasset in $XSAASSETSD do echo "---$xcasset" IMAGESETS="$(find "$xcasset" -name '*.imageset')" for imageset in $IMAGESETS do echo "------$imageset" FILES="$(find "$imageset" -name '*.png')" for file in $FILES do echo "---------$file" sips -m "/System/Library/Colorsync/Profiles/sRGB Profile.icc" $file --out $file done done done echo "------------------------------" echo "script successfully finished" echo "------------------------------" 
+27
Sep 19 '16 at 10:29
source share

I was able to reproduce the problem, and it looks like the images in the Asset Catalog. Failed with Apple (with attached sample project)

Apple Bug Reporter: 28371396

+16
Sep 19 '16 at 21:13
source share

edited script to convert png files to fix the format in the whole project and with spaces:

 #!/bin/bash DIRECTORY=$1 echo "------------------------------" echo "Passed Resources with xcassets folder argument is <$DIRECTORY>" echo "------------------------------" echo "Processing asset:" find "$DIRECTORY" -name '*png' -print0 | while read -d $'\0' file; do echo "---------$file" sips -m "/System/Library/Colorsync/Profiles/sRGB Profile.icc" "$file" --out "$file" done echo "------------------------------" echo "script successfully finished" echo "------------------------------" 
+9
October 13 '16 at 11:34
source share

same problem.

I'm not sure if this is a mistake, but here is my solution: make sure your image resources are without the Adobe RGB (1998) color space

in xcode

+3
Sep 09 '16 at
source share

Adding for someone else with a similar problem ...

The application crashed on iOS 9.0 - iOS 9.2 to what seemed random / around the Storyboard transitions / around the UIImage installation (name ...) .. Found this thread: ( https://forums.developer.apple.com/thread/61643 )

If your application is for iOS 8.4, it will crash on iOS 9.0 - 9.2 in Xcode 8 .. do something with xcassets. Setting the deployment target to 8.2 or lower (I used 8.0) fixed it for me. No kidding. The worst mistake.

+1
Oct 17 '16 at 21:02
source share

Set the goal of deploying iOS inside the info of your project and all goals with the same value.

In my case, my project was configured on iOS 9.1 , and Target was installed on iOS 8.0 and crashing on the simulator with iOS 8.4

Now it works fine.

PS: clean the project before restarting.

0
Sep 27 '16 at 16:25
source share

Despite the fact that an answer has already been given, the accepeted solution does not work for me, since I did not have 16b / ch assets.

I found that the problem arose for assets compressed using the lzfse algorithm (you can find information on extracting extraction information from Assets.car using assetutil ). Unfortunately, the Xcode IDE does not allow developers to change the compression algorithm, but you can do this by manually compiling the assets and omitting the deployment target in the actool .

TL; DR;

  • Archive
  • Unzip ipa
  • Compile assets. You can find the asset compiler command for your xcode-generated project by checking archive logs in the Xcode report navigator

Command example:

xcrun actool --output-format human-readable-text --notices --warnings --minimum-deployment-target 8.0 --output-partial-info-plist info_partial.plist --app-icon AppIcon --launch-image LaunchImage --enable-on-demand-resources YES --sticker-pack-identifier-prefix {bundle_id}.sticker-pack --target-device iphone --target-device ipad --platform iphoneos --product-type com.apple.product-type.application --compile #{path_to_directory_containing_Assets_car} Assets/Assets.xcassets

  1. Write it down.
  2. Resign
0
Sep 18 '17 at 12:42 on
source share



All Articles