MAUI "A RuntimeIdentifier is required for iOS/Mac Catalyst" in CI
Building a MAUI iOS or Mac Catalyst app to a runnable bundle needs a RuntimeIdentifier (such as ios-arm64 or maccatalyst-x64). Without it, the build stops because it cannot decide the target architecture.
What this error means
A MAUI build fails reporting that a RuntimeIdentifier is required to build the iOS or Mac Catalyst target, often when invoking build instead of publish without a RID.
error : A RuntimeIdentifier is required to build and run this application for ios.
Specify a RuntimeIdentifier, for example -p:RuntimeIdentifier=ios-arm64.Common causes
No RID specified for the device build
iOS and Mac Catalyst app bundles are RID-specific; without -p:RuntimeIdentifier, the build cannot target an architecture.
Using build where publish with a RID is expected
Producing a distributable bundle is a publish-with-RID operation; a plain build of the platform head can miss the RID.
How to fix it
Pass an explicit RuntimeIdentifier
- Choose the RID for the target (ios-arm64, maccatalyst-arm64, etc.).
- Pass it on the command line or in the project.
- Use publish to produce the app bundle.
dotnet publish -f net8.0-ios -c Release -p:RuntimeIdentifier=ios-arm64Set a default RID in the project head
Declare a RID for the platform target so CI does not need to pass it each time.
<RuntimeIdentifier Condition="'$(TargetFramework)'=='net8.0-ios'">ios-arm64</RuntimeIdentifier>How to prevent it
- Provide a RID for iOS and Mac Catalyst device builds.
- Use publish (not build) to produce distributable bundles.
- Keep RIDs in the project so CI invocations stay simple.