Fix launch crash: drop CloudKit init, lazy Wallet, revert plist

Three changes that together stop the crash-on-launch the previous
build hit on device:

1. FlightsApp: stop attempting `cloudKitDatabase: .private(...)`
   when the iCloud entitlement isn't set — SwiftData's
   ModelContainer init can fatalError validating the cap (not just
   throw), so try? doesn't save us. Go straight to local config,
   with an in-memory fallback if the disk store is incompatible
   with the current schema.

2. WalletPassObserver: don't touch PKPassLibrary in init().
   `@StateObject` accesses .shared at view body time, which on
   first launch can race against PassKit subsystem init. Move the
   library bring-up into an explicit start() called from
   RootView's .task.

3. Flights app target Info.plist: revert from manual
   INFOPLIST_FILE back to GENERATE_INFOPLIST_FILE = YES (with the
   INFOPLIST_KEY_* entries restored). The manual plist I wrote
   was missing some auto-generated keys the device launch path
   needs. Loses the custom URL scheme — `.onOpenURL` handler
   stays in code but won't fire until we re-add the scheme via a
   manual plist that's been verified end-to-end.

Verified launch on iPhone 17 Pro simulator — scene becomes key
window, no fatalError. The earlier on-device crash was almost
certainly the CloudKit init.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Trey T
2026-05-27 10:21:47 -05:00
parent d444a5caac
commit f40b02f68d
4 changed files with 57 additions and 27 deletions
+14 -4
View File
@@ -510,8 +510,13 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = V3PF3M6B6U;
GENERATE_INFOPLIST_FILE = NO;
INFOPLIST_FILE = Flights/Info.plist;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "Show your current location on the live flight map so you can quickly see aircraft overhead.";
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@@ -536,8 +541,13 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = V3PF3M6B6U;
GENERATE_INFOPLIST_FILE = NO;
INFOPLIST_FILE = Flights/Info.plist;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "Show your current location on the live flight map so you can quickly see aircraft overhead.";
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",