.NET MAUI iOS – Azure Pipelines error: ‘x’ is not available in iOS 16

The Error: The error message suggests that the ‘UIKit.UISceneSessionActivationRequest’ type, used as a parameter in ‘UIKit.UIApplication.ActivateSceneSession,’ is not available in iOS 16.2 and was introduced in iOS 17.0. This discrepancy indicates a version misalignment in the development environment, specifically with the iOS SDK and Xcode.

Root cause

The root cause of this error lies in the version of the macOS image used in the Azure Pipelines configuration. By default, the ‘macOS-latest’ image is pulled, which corresponds to macOS 12 (at the time of the blog post). However, the .NET MAUI app with Azure Pipelines requires macOS v13 to work seamlessly, as it aligns with the necessary dependencies for iOS development.

Resolution

To resolve this error, developers need to update the macOS image specified in the Azure Pipelines configuration. Instead of using ‘macOS-latest,’ the configuration should be modified to use ‘macOS-13.’ This ensures that the appropriate version of macOS is utilized during the build process, addressing the compatibility issues with iOS 16.2 and the required UIKit types.

Step-by-Step

-Open your Azure Pipelines configuration file (typically named azure-pipelines.yml).
-Locate the section where the macOS image is specified. It might look something like this:

pool:
  vmImage: 'macOS-latest'

-Update the image reference to ‘macOS-13’:

pool:
  vmImage: 'macOS-13'

-Save the changes to the configuration file.
-Commit the updated configuration file to your version control system (e.g., Git).
-Trigger a new build in Azure Pipelines, and the updated macOS image will be used.

This content has 9 months. 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.

Leave a Comment

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