Solving .NET MAUI Issues on macOS Sequoia with Visual Studio Code and XCode 16

Victor Hugo Garcia - Sep 19 - - Dev Community

Developing cross-platform mobile applications with .NET MAUI can be a rewarding experience, but it comes with its own set of challenges, especially when Apple releases a new version of macOS and XCode. In this blog post, I will share my personal journey of overcoming a specific issue that I encountered while trying to develop my .NET MAUI mobile app projects. Whether youโ€™re a seasoned developer or just starting out, I hope my insights and solutions will help you navigate similar challenges and streamline your development process. Letโ€™s dive in and explore how to get your .NET MAUI projects up and running smoothly on macOS Sequoia!


Tips Before Start

Based on my experience developing mobile apps in .NET MAUI, here are a few key tips to keep in mind:

  • Disable macOS automatic updates
  • Disable App Store automatic updates
  • Enable notifications from the macios official repository and regularly check for updates, especially when a new major macOS or Xcode release is approaching.

The Issue

While working on the latest version of macOS, I discovered that XCode 15.4 was incompatible, necessitating an upgrade to XCode 16. However, after updating, .NET MAUI stopped working due to compatibility issues.

How To Solve It

There is an issue created a few months ago on the macios repository. This issue outlines the official recommendations, and helps to ask questions so other friends can provide some workarounds that may work for you.

Visual Studio Code

If you are using Visual Studio Code to develop .NET MAUI projects, you might encounter a couple of issues after updating to macOS Sequoia. Below are the issues I found and their respective solutions:

Could not find the task 'maui: Build'

This particular error is due to a known issue on the .NET MAUI extension with the HotReload feature. Solution: Our friend BretJohnson recommended disabling XAML Hot Reload and see if the problem goes away. Uncheck the user preferences checkbox shown here.
Image description

XCode Versions

Our friend BrandanN21 recommended to downgrade my xcode version by installing it via the Apple Developer Portal and finding xcode 15.4, you can have multiple xcode installs at the same time. To have multiple xcode installs at the same time, follow these steps:

  • Once you download the .xip file from the portal, uncompress it, and the XCode.app file rename it to XCode_15.4.app
  • Move the renamed XCode app to the Applications folder
  • Make sure you have both XCode versions as shown here: Image description
  • Open the terminal and execute the following command: /Applications/Xcode_15.4.app/Contents/MacOS/Xcode this command will open XCode 15.4 correctly
  • Go to XCode menu and click the Settings option, then go to the Locations tab and make sure to select the correct command line tools version 15.4 as shown here: Image description
  • Close XCode and the terminal
  • Open the terminal again and run the following command:xcode-select --print-path it should display /Applications/Xcode_15.4.app/Contents/Developer this confirms you have the correct xcode version selected as default.
  • Now run your app by selecting the correct simulator and that's all.

Note: I did not install the iOS 18 simulators, since I will wait for the official support in .NET MAUI macios.

Additional Workarounds and Resources

I recommend you to follow this issue thread to find out other workarounds that may work for you if you are using Visual Studio for Mac or Rider. A lot of friends are posting their solutions and changes they applied to solve this compatibility issue.

Conclusion

By staying proactive and informed, you can overcome compatibility issues and ensure a smooth development process. Remember to disable automatic updates, stay connected with the macios community, and leverage the collective knowledge available to you.

Microsoft is expected to release the official XCode 16 support on November this year.

I would like also to thank everybody on the GitHub issues who posted the workarounds and feedback, they truly helped me to workaround the issue.

Follow me on social:

. . . . . . . . . . . . . . . . .
Terabox Video Player