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.
Updates
#1
On September 26, 2024 - The macios team released the official support for macOS Sequoia, and XCode 16 in .NET 8 here
#2
If you face the following issue with the provisioning profiles:
The specified iOS provisioning profile '**********' could not be found
, the solution that worked for me was to move them from ~/Library/Developer/Xcode/UserData/Provisioning Profiles To ~/Library/MobileDevice/Provisioning Profiles, thanks to @vedatozkanTr for the help.
#3
The following error may re-appear when building using XCode 16: strip exited with code 139
, the solution I applied was found on this post, what I did was just update the .csproj file and added the following property group:
<PropertyGroup >
<MtouchNoSymbolStrip Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">True</MtouchNoSymbolStrip>
</PropertyGroup>
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.
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:
- 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:
- 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:
- LinkedIn victorhugogarcia
- GitHub vhugogarcia
Top comments (2)
Thank you for this. It helps me a lot!
Didnt help me, but thanks.