Xamarin iOS: Do all images need to be in the Asset Catalogue?

Viewed 773

Visual Studio 2019 (Windows) Xamarin 4.6.0.847

I will start with the actual question (there is a second, related question at the end):

Do I have to include all images inside the asset catalogue when publishing an iOS App to the Apple store / TestFlight etc?

I noticed, that although the images show up when I run the App on an iPhone connected to my MAC, they are nowhere to be found in the XCode project. Therefore I am concerned they are not being uploaded to Apple as part of my latest build. All of my images are PNG and within the Resources folder.

It's the first build I have uploaded, so I guess I'll just have to wait and see (approx a weeks time apparently).

I also noticed the launchscreen.storyboard on my PC is not the same as the one in the XCode project. Why is it not being copied across?

But in the meantime, I could upload another build if the images DO need to be in the Asset catalogue.

Any advice appreciated.

1 Answers

Even though it is preferable to use Asset Catalogue, you can safely go with putting all your images in the Resources folder as well. I would strongly advise you not to go with the Resources approach due to a couple of reasons:

  1. The management for images is a lot easier with Asset Catalogue
  2. You can also easily put *.pdf files and reference them across multiple platforms & resolutions inside the Contents.json file.
  3. You cannot theme your app (have both light & dark theme) with Resources folder approach.

If you don't plan any of that, or don't want to take the time to move everything into the Asset Catalogue, you can safely stat with the Resources approach, at least for now. I haven't seen any plans from Apple to remove this functionality.

About the launchscreen.storyboard - this is a known issue with iOS and Xamarin. Occasionally, the build process doesn't think that the storyboard file has been updated and simply ignores it during the build. What you can do is:

  1. Delete bin & obj folders for the iOS project on your Windows machine;
  2. Delete the build files on your Mac machine. They are located in /Library/Caches/Xamarin/mtbs/. You can delete only your current project's build folder - you don't need to delete all of the other projects' builds.
  3. Rebuild & deploy your project and everything should be fine.

P.S. Keep in mind that sometimes the iOS device can also cache the file, so an uninstall and reboot of the device may be required.

Related