This is an FYI for any of you out there using asset libraries in your iOS projects on Xcode 8.
I would make sure that you run a validate on your IPA to find out if this will be an issue for you now, rather then when you need to submit your app, it gets uploaded and then rejected after a 20 minute upload to iTunes Connect.
If you get this message:
Please note that what you think 16-bit means and what that error message thinks 16-bit means are two completely different things.
Two weeks I looked into this and I followed the helpful info at the link below
And I knew that we had no 16 bit images because 1, I made all of those that were new and 2, all the old ones were 8 bit without alphas and 3, I have no idea what the hell a p3 asset is and I'm sure I didn't create one.
But with the GMC of Xcode 8.1 spied up on the developer portal yesterday, I decided to take a stab at this again.
Sure enough. The validation on the IPA reported that same error, but did not list the files that were in error : /
Following the directions at the link above, with the assets.car file being decoded into an assets.json, I saw a few things.
FRIENDLY TIP IF YOU HAVE THIS PROBLEM: drop your Assets.car file either at your HD/SSD root or at the root of your user folder and paste the appropriate one of these lines below into the terminal:
sudo xcrun --sdk iphoneos assetutil --info ~/Assets.car > ~/Assets.json
sudo xcrun --sdk iphoneos assetutil --info /Assets.car > /Assets.json
After you run run the command, you will see output indicating that something is wrong, but again, the tool will not tell you which file has the problem. Seriously? Who thought that was a good idea? > : [
Now, here's the fine point that was not addressed in the link above and what can lead to a misleading error message.
Open and search the Assets.json file and search for all occurrences of these strings and see what the resulting amounts are.
"BitsPerSample" : 8, "BitsPerSample" : "BitsPerSample" : 16,
Note that this is BitsPerSample, not BitsPerPixel. This was my major oversight. In reading "16-bit" in the error message, it was assumed that the error was about 16 bit per pixel images - because I had never heard of "16 bits per" applying to anything else with regards to images.
As it happened, there are no images that are 16 bits per pixel, but as for BitsPerSample, there they are
{ "PixelWidth" : 101, "ColorModel" : "RGB", "SizeClass Vertical" : "universal", "PixelHeight" : 101, "Name" : "Connection Status - Connected", "Scale" : 1, "Idiom" : "universal", "BitsPerSample" : 16, "Encoding" : "ARGB", … { "PixelWidth" : 100, "ColorModel" : "RGB", "SizeClass Vertical" : "universal", "PixelHeight" : 104, "Name" : "Connection Status - Disconnected", "Scale" : 1, "Idiom" : "universal", "BitsPerSample" : 16, "Encoding" : "ARGB",
Looking at these images in the Finder, they clearly were not 16 bit images, but 8. Looking at them in Preview showed the same thing. But here's where the difference lied.
I had created these images in Illustrator and exported them and rescaled them in Preview. When them scaling down, I left two out of the 4 images at 150 pixels per inch, instead of 72. When these were compiled in the asset library, that ended up creating these "16-bit" assets that Xcode 8 was complaining about.
So, the error message isn't necessarily about 16 bit images as we traditionally know them and even when creating 8 bit images, it's possible that they will be represented as 16 bit per sample images.
If you get this error and you know you don't have any 16 bit images, check if any of your images' resolution is over 72 DPI.
Here's the info from Preview
File contained within: Connection Status - Connected.imageset Color Model: RGB Depth: 8 DPI Height: 150.01 DPI Width: 150.01 Has Alpha: 1 Pixel Height: 101 Pixel Width: 101 Profile Name: Adobe RGB (1998)
|