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?
Xcode 8 build crash on iOS 9.2 and below
16.6k views Asked by Lingzhi Zhang AtThere are 8 answers
On
I hope this bash script may help you. Input argument is directory than contains all xcassets of your project. This script will set sRGB profile to all pngs. 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 "------------------------------"
On
I was able to reproduce the problem and it does seem related to images in Asset Catalog. Filed a bug with Apple (with attached sample project)
Apple Bug Reporter: 28371396
On
edited script to convert png files to correct format in whole project and with white 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 "------------------------------"
On
Adding for anyone else with a similar problem...
App was crashing on iOS 9.0 - iOS 9.2 on what seemed random / around Storyboard transitions / around setting an UIImage(name...).. Found this thread: (https://forums.developer.apple.com/thread/61643)
If your app is targeting iOS 8.4, it will crash on iOS 9.0 - 9.2 in Xcode 8.. something to do with xcassets. Setting the deployment target to 8.2 or below ( I used 8.0) fixed it for me. No kidding. Worst bug ever.
On
Although question has been already answered, accepeted solution doesn't work for me, as I didn't have any 16b/ch assets.
I found that issue appeared for assets which were compressed using lzfse algorithm (you can find information about compression extracting info from Assets.car using assetutil). Unfortunately Xcode IDE doesn't allow developers to change compression algorithm, however you can do that by compiling assets manually and lowering deployment target in actool command.
tl;dr;
- Archive
- Unzip
ipa - Compile assets - You can find asset compiler command for your project generated by xcode by checking archive logs in Xcode report navigator
Example command:
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
- Zip it.
- Resign
See the accepted answer https://forums.developer.apple.com/thread/60919
You can save 16-bit assets as 8-bit ones with Preview.app