Solution: app crash on iOS 12 build from Xcode 15

Description

Solution: app crash on iOS 12 build from Xcode 15

Description

One of my iOS application with Realm currently crash on iOS 12 when build on Xcode 15.

When apply the first item of the solution, it can build for Debug configuration, but it crashes on Release configuration.

After apply the second item of the solution, it can run on iOS 12 application on Release configuration.

Solution

  1. Add -Wl , -ld_classic options for Other Link Flags in Build Settings.

2. Added SwiftUI.framework with Optional status in Build Phases.

Resources

  1. dyld: Library not loaded: /System/Library/Frameworks/SwiftUI.framework/SwiftUI
  2. Workaround: Add -Wl,-weak_reference_mismatches,weak or -Wl,-ld_classic options to the OTHER_LDFLAGS build setting.