The answer to my question is probably very simple but I've spent twelve hours trying to find it myself and I am at my wit's end. Searching the web shows multiple sufferers from, and multiple answers to, this same problem from at least ten years ago.
I've a SwiftUI macOS/iOS app that is not finished but at a stage where I want to get it ready for TestFlight. I set it up on App State Connect and set Xcode Cloud to build it on GitHub commits.
The first build revealed some obvious omissions, easily fixed, then I hit this one, for macOS: Missing required icon. The application bundle does not contain an icon in ICNS format, containing both a 512x512 and a 512x512@2x image.
[In passing, I'll note the app, passes muster for the iOS platform]
I make a 1024x1024 PNG .. convert it to ICNS with GraphicConverter .. convert it again with iconutil to a iconset and add it to my app. I do a regular build in Xcode and, there it is, my .icns
file in the app bundle.
I commit to fire off another Xcode Cloud build, but get the same error. Especially frustrating because I can see the ".. application bundle does contain an icon in ICNS format, containing both a 512x512 and a 512x512@2x image".
It's hard to debug from an abundantly obvious incorrect diagnostic, but I do have to get past this and start fiddling with assorted settings .. ten builds later, still no joy.
I did notice that my Info.plist
file (autogenerated) doesn't contain the string "icon" and that, for example, Mail.app has:
<key>CFBundleIconFile</key>
<string>ApplicationIcon</string>
<key>CFBundleIconName</key>
<string>ApplicationIcon</string>
If the build process checks for an icon based on the Info.plist
contents then the reported error could be more correct, ".. application bundle's Info.plist file makes no reference to an icon in ICNS format .."
One possible complication is that my app includes embedded custom fonts and so it need a Fonts.plist
file for them. I set that file as my INFOPLIST_FILE
<key>UIAppFonts</key>
<array>
<string>Zerlina.otf</string>
<string>Gorton-Condensed.otf</string>
<string>Gorton-Normal-180.otf</string>
<string>Gorton-Normal-120.otf</string>
</array>
<key>ATSApplicationFontsPath</key>
<string>.</string>
The contents of Fonts.plist
are copied to the final Info.plist
. Maybe that defeated some of the Info autogeneration? I see no setting for CFBundleIconFile
so can't add it myself.
I'm confident pressing "Submit" on this will suddenly clear my mental murk but, for now, I need help .. thanks for any ..
How to do this properly is quite well described atL
https://stackoverflow.com/questions/46216718/missing-cfbundleiconname-in-xcode9-ios11-app-release
.. in short, work in the app's "App Icons and Launch Screens" section and Info.plist
will take care of itself.