Skip to content

[PSA] Starting with Xcode 27 (And iOS27) you MUST use the Scene life cycle #26837

Closed

Description

@JPZV

Apple platform

iOS

Framework version

net10.0-*

Affected platform version

Xcode27 with iOS27

Description

Recommendations for the developers

#23058 already talked about Apple requesting the devs to use the UIScene life cycle, with iOS26, but that was a warning actually. From now on, starting with iOS27, the app will crash in both iPhone/iPad and Simulators running iOS27 if you're still using the old AppDelegate life cycle.

Currently the New App template from VS2026 still uses the old method. I don't know if this has to be updated from macios team, from maui team, or from VS team, but if your app is crashing or you're gettings users report about the app crashing at start, then you should look if you have the UIScene delegate (which is pretty simple to do):

  1. You have to create the following file: [ProjectFolder]/Platforms/iOS/SceneDelegate.cs and add this:
using Foundation;
using Microsoft.Maui.Platform;
using System;
using System.Collections.Generic;
using System.Text;
using UIKit;

namespace [ProjectNamespace].Platforms.iOS
{
    [Register("SceneDelegate")]
    public class SceneDelegate : MauiUISceneDelegate
    {
    }
}
  1. Add the following in your info.plist:
    <key>UIApplicationSceneManifest</key>
    <dict>
        <key>UIApplicationSupportsMultipleScenes</key>
        <true/>
        <key>UISceneConfigurations</key>
        <dict>
            <key>UIWindowSceneSessionRoleApplication</key>
            <array>
                <dict>
                    <key>UISceneConfigurationName</key>
                    <string>__MAUI_DEFAULT_SCENE_CONFIGURATION__</string>
                    <key>UISceneDelegateClassName</key>
                    <string>SceneDelegate</string>
                </dict>
            </array>
        </dict>
    </dict>
  1. If you're targeting iOS 12 (or even below), don't delete the AppDelegate.cs. If you're targeting iOS13 or above, then you could delete AppDelegate.cs though it's not actually necessary as the app will launch the best Life cycle method according to the device.

  2. Fully Clear and rebuild your solution (just in case). Remember to delete both obj/bin after running the clean command.

Recommended actions for the maintainers

  • Mark MauiUIApplicationDelegate as deprecated in favor of MauiUISceneDelegate
  • Update the iOS template to follow the above instructions
  • Optional: Create a note/PSA/documentation about a native iOS crash with the error ___UIApplicationEvaluateRuntimeIssueForNoSceneLifecycleAdoption_block_invoke. Below is an example about the mentioned exception.

Steps to Reproduce

  1. Create a new .Net MAUI App project
  2. Check if the file [ProjectFolder]/Platforms/iOS/SceneDelegate.cs exists. If it does, then the issue was resolved at least with the New App Template. If you want to reproduce the issue, delete that file and the UIApplicationSceneManifest in info.plist
  3. Build, Deploy and Launch the app in a iOS27+ Device or simulator
  4. The app will try to launch and it will exit immediately. VIsual Studio will not recognize the crash while the Mac Host will say the app crashed and will show a native exception report.
  5. Build, Deploy and Launch the app in a -iOS26 Device or Simulator, and the app will run as it should be even with the same SDK/Environment.

Did you find any workaround?

Create SceneDelegate.cs file and add UIApplicationSceneManifest to the info.plist as mentioned above

Relevant logs

-------------------------------------
Translated Report (Full Report Below)
-------------------------------------
Process:             [App] [19905]
Path:                /Users/USER/Library/Developer/CoreSimulator/Devices/3CD0E5ED-047E-497E-93FE-236D9D7E2B8F/data/Containers/Bundle/Application/FCD945C3-C1C8-4EE0-A08C-4416BD7EC965/[App].app/[App]
Identifier:          com.example.app
Version:             1.0.0 (1)
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      launchd_sim [19702]
Coalition:           com.apple.CoreSimulator.SimDevice.3CD0E5ED-047E-497E-93FE-236D9D7E2B8F [3411]
Responsible Process: SimulatorTrampoline [3387]
User ID:             502

Date/Time:           2026-10-02 10:03:52.7221 -0700
Launch Time:         2026-10-02 10:03:48.0177 -0700
Hardware Model:      Mac18,5
OS Version:          macOS 27.0.1 (26A434)
Release Type:        User

Crash Reporter Key:  074E83F2-51A1-5F2D-4230-30F4E11D5BA4
Incident Identifier: DB125CAE-92E9-4FCD-B9E0-383F3AF8A453

Time Awake Since Boot: 7600 seconds

System Integrity Protection: enabled

Triggered by Thread: 0  tid_103, Dispatch Queue: com.apple.main-thread

Exception Type:    EXC_BREAKPOINT (SIGTRAP)
Exception Codes:   0x0000000000000001, 0x00000001c48c336c

Termination Reason:  Namespace SIGNAL, Code 5, Trace/BPT trap: 5
Terminating Process: exc handler [19905]


Thread 0 Crashed:: tid_103 Dispatch queue: com.apple.main-thread
0   UIKitCore                     	       0x1c48c336c ___UIApplicationEvaluateRuntimeIssueForNoSceneLifecycleAdoption_block_invoke + 712
1   libdispatch.dylib             	       0x1e6435fb8 _dispatch_client_callout + 12
2   libdispatch.dylib             	       0x1e641dfa0 _dispatch_once_callout + 28
3   UIKitCore                     	       0x1c48e5010 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 320
4   UIKitCore                     	       0x1c4312c20 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 260
5   FrontBoardServices            	       0x1e284e108 __95-[FBSScene _callOutQueue_didCreateWithTransitionContext:alternativeCreationCallout:completion:]_block_invoke + 304
6   FrontBoardServices            	       0x1e284e608 -[FBSScene _callOutQueue_maybeCoalesceClientSettingsUpdates:] + 116
7   FrontBoardServices            	       0x1e284df78 -[FBSScene _callOutQueue_didCreateWithTransitionContext:alternativeCreationCallout:completion:] + 392
8   FrontBoardServices            	       0x1e28b26e4 __93-[FBSWorkspaceScenesClient _callOutQueue_sendDidCreateForScene:transitionContext:completion:]_block_invoke.282 + 216
9   FrontBoardServices            	       0x1e285b230 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 160
10  FrontBoardServices            	       0x1e2875408 -[FBSWorkspaceScenesClient _callOutQueue_sendDidCreateForScene:transitionContext:completion:] + 392
..........

Activity

  1. JPZV commented on Oct 3, 2026

    @JPZV
    Author

    By the way, Apple may actually approve the app even if your didn't implement the UIScene. That obviously is NOT right as they failed to detect the crash by running an outdated device. This obviously depends on each case, but don't assume if your app passed the review without UIScene means it's free of the issue.

  2. TRCarbone commented on Oct 5, 2026

    @TRCarbone

    My iOS platform program.cs looks like this:

    using UIKit;

    namespace MyProject
    {
    public class Program
    {
    // This is the main entry point of the application.
    static void Main(string[] args)
    {
    // if you want to use a different Application Delegate class from "AppDelegate"
    // you can specify it here.
    UIApplication.Main(args, null, typeof(AppDelegate));
    }
    }
    }

    I added SceneDelegate.cs and amended the info.plist file. Do I need to change anything in program.cs?

  3. JPZV commented on Oct 5, 2026

    @JPZV
    Author

    That's a good question. For what I understand iOS loads the Scene according to info.plist just like Android does with MainActIvity. I'm not sure if iOS27 still uses program.cs at all

  4. TRCarbone commented on Oct 5, 2026

    @TRCarbone

    That's a good question. For what I understand iOS loads the Scene according to info.plist just like Android does with MainActIvity. I'm not sure if iOS27 still uses program.cs at all

    If I breakpoint at UIApplication.Main(args, null, typeof(AppDelegate)); it is hit running on iOS27. It does now work on ios27 with the fix, just odd that AppDelegate is still referenced in that line.

  5. danardelean commented on Oct 6, 2026

    @danardelean

    Confirmed on Xcode 27.0 (27A266a), .NET SDK 10.0.401, workload set 10.0.401.1, iOS 27.0 simulator. A few additions:

    • The template is fixed from MAUI 10.0.110 ([iOS/MacCatalyst] Adopt scene lifecycle and AppActions dispatch maui#38601 / #38664). Templates 10.0.100 and earlier, and the .NET 11 RC 1 template, still lack the scene files. Existing projects must add them by hand; updating the NuGet package changes nothing.
    • The official template uses UIApplicationSupportsMultipleScenes = false; true also enables multi-window on iPadOS and Mac Catalyst.
    • Mac Catalyst is affected too: the same no-scene app built with the macOS 27.0 SDK crashes on macOS 27.0.1 with the identical EXC_BREAKPOINT, so the Catalyst head needs the same SceneDelegate and manifest.
    • After the fix, AppDelegate.OpenUrl is no longer called (move URL callbacks to SceneDelegate.OpenUrl), and the window is created in WillConnect, not in FinishedLaunching. Program.cs and AppDelegate stay.

    Full write-up with the template version matrix and the two production gotchas: https://dev.to/danardelean/your-net-maui-ios-app-will-crash-at-launch-with-xcode-27-here-is-the-two-file-fix-mlm

  6. Axemasta commented on Oct 6, 2026

    @Axemasta

    Thanks for this PSA, after upgrading my maui app was crashing upon startup and the lack of scene delegate was the reason. It would be very much appreciated if this was more prominent in the release notes!

  7. rolfbjarne commented on Oct 13, 2026

    @rolfbjarne
    Member

    I've updated our release notes a bit, stating that apps built with Xcode 27 must use the UIScene lifecycle.

    Closing since there is nothing actionable left on our side: MAUI's templates have already been fixed (dotnet/maui#38601), and at this point we're just waiting for them to be released (if they haven't already).

  8. Axemasta commented on Oct 14, 2026

    @Axemasta

    Another PSA for people adding scene kit to their maui apps for the first time. Check if the lifecycle events you've setup will need to be ported to use the scene kit equivalents!

    OnActivated, OpenUrl etc will all break and require the SceneKit equivalent api's. I learned this the hard way!

  9. AlleSchonWeg commented on Oct 23, 2026

    @AlleSchonWeg

    Hi,
    i have a question about this. In my MauiProgram.cs i register FirebaseCloudMessaging:

    #elif IOS
    	events.AddiOS(iOS => iOS.FinishedLaunching((_, __) => {
    		CrossFirebase.Initialize();
    		FirebaseCloudMessagingImplementation.Initialize(true);
    		return false;
    	}));
    #endif

    It is now necessary to move this into SceneWillConnect ?

    #elif IOS
    	events.AddiOS(iOS => iOS.SceneWillConnect((_, __, ___) => {
    		CrossFirebase.Initialize();
    		FirebaseCloudMessagingImplementation.Initialize(true);
    	}));
    #endif
  10. Axemasta commented on Oct 23, 2026

    @Axemasta

    @AlleSchonWeg I would test it with your debugger to verify if the method is still being called!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions