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 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.

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

  1. 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 ????


Leave a Comment

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