Troubleshooting Xamarin and .NET MAUI: iOS Deployment Issues after XCode Upgrade

Are you facing deployment issues with your Xamarin or .NET MAUI iOS app after upgrading XCode? You’re not alone. Many developers encounter the frustrating “/usr/bin/xcrun exited with code 1” error message, coupled with the “actool exited with code 1” and an error about failing to locate a simulator runtime. In this blog post, we’ll delve into this problem and provide you with a solution to get your iOS app deployment back on track.

Understanding the Problem

After upgrading XCode to a newer version, you may notice that you can’t deploy your Xamarin or .NET MAUI iOS app to physical iOS devices, and the simulator targets are mysteriously missing from the drop-down menu where you select deployment targets. This issue can be perplexing and hinder your development workflow.

The error message you encounter typically looks something like this:

Resolution

To tackle this deployment challenge, you should delve into your XCode configuration and confirm that the iOS platform is both accessible and correctly installed on your development machine. Follow these steps:

  1. Launch XCode on your Mac.
  2. Click on “XCode” in the top menu bar and choose “Preferences.” This will open the XCode preferences window.
  3. Within the preferences window, select the “Platforms” section. Here, you’ll find the key settings related to platform configuration.
  4. After you’ve confirmed that all the required iOS components are installed, close and restart Visual Studio (or your preferred development environment).

Xamarin.iOS : “Failed to compile the generated registrar code” on Visual Studio for Mac

If you have recently upgraded your XCode version to 14.0, and installed the XCode command line tools too, you will probably notice some error messages when trying to run your Xamarin.Forms, or iOS application from Visual Studio for Mac.

Error MT4109: Failed to compile the generated registrar code.

What actually helped me, is this:
Navigate to https://developer.apple.com/download/all/ and search for Command Line Tools for Xcode 13.4 and Xcode 13.4. Both downloads are big, the XCode itself around 10GB and the CL Tools are around 1GB, so definitely do not do this on metered connections.

Once the downloads are ready, open the XCode.XP file with the Package Archiver, let it extract to downloads, then move it to Applications folder.

After that, install CL tools. Follow the installer’s instructions.

Boom, it’s solved. Issue reported at: https://github.com/xamarin/xamarin-macios/issues/15954

This content has 1 year. Some of the information in this post may be out of date or no longer work. Please, read this page keeping its age in your mind.

Xamarin.UWP FontImageSource does not get displayed

You may have noticed that if you give an image a FontImageSource, the image does not display properly on the UWP platform. This is probably because the default value of the FontImageSource Color property is white, and you probably want to draw it white. Check if you are giving an explicit value to the Color property. If not, try it.

				            <Image>
					            <Image.Source>
                                    <FontImageSource 
                                                    FontFamily="FontIcons"
                                                    Color="Black"
                                                    Glyph="?"
                                                    Size="25" />    
                                </Image.Source>
				            </Image>
This content has 2 years. Some of the information in this post may be out of date or no longer work. Please, read this page keeping its age in your mind.

Forms.RecurrenceToolkit is discontinued

Just as Xamarin.Forms is changing to a .NET MAUI, banditoth.Forms.RecurrenceToolkit will also undergo a change. As of today, I do not plan to develop any new functionality in the aforementioned package. Some parts of the package will be developed for .NET MAUI compatibility. You will be able to find the new packages in the future with the banditoth.MAUI prefix, which will also be available on GitHub.
I would like to thank you for the more than 2700 downloads.
Bug fixes will continue to be made, so if someone actually uses this for a live application, in that case no worries.

Let’s look at some statistics. The most popular package was MVVM with a total of 623 downloads. This was followed by the Logging package with 459 downloads. The Multilanguage and Converters packages were similarly successful, with around 430 downloads.

I will be back soon with MAUI packages 😉

This content has 2 years. Some of the information in this post may be out of date or no longer work. Please, read this page keeping its age in your mind.

Xamarin: Project not selected to build for this solution configuration

If your Xamarin Android, iOS or UWP application is not starting when you are hitting the Run or F5 button, then probably your Build configurations are misconfigured. This usually happens when you are opening a too old source code. No worries, we will have a solution for it.

Solution

Right click on your solution, and select configuration manager
Ensure that the desired project has the deploy column ticked.
This content has 2 years. Some of the information in this post may be out of date or no longer work. Please, read this page keeping its age in your mind.