-[AppDelegate window]: unrecognized selector sent to instance
The app crashes when a library shows something (a picker, a menu, an ad, a snackbar) or right at launch:
-[AppDelegate window]: unrecognized selector sent to instance
Why. With the UIKit scene life cycle the window belongs to the scene delegate, and AppDelegate has no window property at all. That is the React Native 0.88 template, Expo SDK 58, and Expo SDK 57 with enableSceneSupport. Apps built with the iOS 27 SDK must use scenes (why), so this crash arrives with the move to Xcode 27. Libraries that still find the screen with [UIApplication sharedApplication].delegate.window send a message the AppDelegate no longer answers.
Which libraries. Checked in each library's iOS source (October 2026):
| Library | Crashes | Fix |
|---|---|---|
| @react-native-firebase/messaging | at launch | upstream PR #9359 |
| react-native-blob-util | open-in / options menu | PR #498 |
| react-native-google-mobile-ads | banners, consent form, ad inspector | PR #911 (approved) |
| react-native-image-crop-picker | opening the picker or camera | PR #2257 |
| react-native-date-picker | opening the modal picker | PR #978 |
| react-native-contacts | closing the contact form | PR #841 |
| react-native-ui-lib | KeyboardInput dismissKeyboard | PR #4053 |
| react-native-snackbar | showing a snackbar | PR #220 |
| react-native-print | presenting the print dialog | PR #237 |
| rn-fetch-blob, react-native-youtube, react-native-safari-view | various | unmaintained: switch to a maintained fork or alternative |
Upgrade once a release includes the fix. A blob-util and a google-mobile-ads crash were reproduced on a fresh React Native 0.88.0-rc.4 app in the iOS simulator; the others use the same call.
Quickest workaround, in your app. Give the AppDelegate its window property back and set it from the scene delegate, so every library finds a window without patches:
// AppDelegate.swift
var window: UIWindow?
// SceneDelegate.swift, after creating the window
(UIApplication.shared.delegate as? AppDelegate)?.window = window
Or fix the library with patch-package. In the library's iOS file, replace the window lookup with React Native's helpers from <React/RCTUtils.h>, which work with and without scenes:
- UIViewController *root = [UIApplication sharedApplication].delegate.window.rootViewController;
+ UIViewController *root = RCTKeyWindow().rootViewController;
When the code then walks presentedViewController to the top, RCTPresentedViewController() does both in one call. Add #import <React/RCTUtils.h> if the file doesn't have it, then npx patch-package <library>.
Find the library. The crash log names the method that sent the message. Or search your dependencies:
grep -rnE "delegate]?.window|delegate] window]" node_modules/*/ios node_modules/@*/*/ios
npx nativekeel lists the known ones from your package.json, with when each one crashes.
npx nativekeel