András Tóth‘s professional blog
banditoth.net

Hey there 👋, I’m banditoth a .NET MAUI developer from Hungary.
I write about software development with .NET technologies.

You can find me on:
LinkedIn | Github | StackOverflow | X / Twitter | Threads

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

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.

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

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

  1. Janis Avatar
    Janis

    To have a parallel installation of XCode 15 and XCode 14.3.1 follow these steps:

    – Rename downloaded the XCode.app to Xcode_14.app before moving it to Applications folder
    – change VisualStudio Settings/SDK Locations/Apple SDK to your new Xcode_14.app path

    toggle the last step to switch your Xcode Environment ????

    1. banditoth Avatar
      banditoth

      Thanks your advice on this Janis!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.