2

I'm currently trying out Avalonia 11 on iOS. The dev + test experience has been great, but I can't quite figure out how to add an app icon for distribution. The Avalonia docs don't seem to cover this, as of now.

In MAUI it's as simple as adding a <MauiIcon> tag in the .csproj and pointing it at an svg. Avalonia doesn't seem to have any built in support for this, and adding an SVG to the Resources folder in the iOS project doesn't seem to work either.

The app store uploader (Transporter) complains that "Asset validation failed (90713) Missing Info.plist value. A value for the Info.plist key 'CFBundleIconName' is missing in the bundle [...] `

I can add the entry but I don't know where to point it. Any thoughts?

2 Answers2

2

SOLVED For anyone who comes across this in the future:

It doesn't really have anything to do with Avalonia. It seems to be an implementation detail of iOS and Xcode builds. (I'm new to iOS development)

I did the following:

  1. Create a new Assets.xcassets folder in the same directory as my iOS.csproj.
  2. Open Assets.xcassets in Xcode
  3. Use Xcode to add the relevant assets (in my case, a single 1024 x 1024 .png was all I needed for iOS)
  4. Add the following to your Info.plist
    (In this case, my appicon.png is named AppIcon within Xcode)
<key>XSAppIconAssets</key>
<string>Assets.xcassets/AppIcon.appiconset</string>

The error returned from App Store Connect and Transporter is a bit misleading in this way, because it suggests adding CFBundleIconName. That may work too, but I didn't test it.

  1. Build the .ipa bundle by running
dotnet publish -f net7.0-ios -c Release -p:ArchiveOnBuild=true -p:RuntimeIdentifier=ios-arm64
  1. Upload the .ipa bundle in /bin/Release.net7.0-ios/ios-arm64/publish to App Store Connect.

I do wish this were documented somewhere in the Avalonia UI docs, even if it's not technically an Avalonia issue. It was a lot of effort to take the template and make it actually deployable to the App Store. Really love the framework though.

Update: There is now an open issue on the Avalonia docs to explain this: https://github.com/AvaloniaUI/Documentation/issues/423

  • Excellent! There's an existing docs on [change iOS app icon](https://learn.microsoft.com/en-us/dotnet/maui/user-interface/images/app-icons?view=net-maui-7.0&tabs=macios) You can check [Accept Your Own Answers](https://stackoverflow.blog/2009/01/06/accept-your-own-answers/?_ga=2.236136769.1167051288.1683246367-530046372.1660608907) as it's helpful to others facing the same problem. – Alexandar May - MSFT May 05 '23 at 05:44
0

As Avalonia doesn't do packaging, this question is related to MS tooling. From what I know, this documentation is still up to date https://learn.microsoft.com/en-us/xamarin/ios/app-fundamentals/images-icons/app-icons?tabs=macos

Max Katz
  • 81
  • 2