skip to Main Content

I’m developing an app targeting iOS 15.0 and macOS 13.0. When I run it using Xcode 15.0 (RC1 or stable) on macOS 13.5.2, it crashes on startup—except when running on iOS 17. This occurs both on physical devices and simulators.

Error Details

Console throws a dyld: Symbol not found error, pointing at a SwiftUI symbol:

dyld: Symbol not found: _$ss5NeverO7SwiftUI10ShapeStyleACWP

It references paths for the iOS simulator and Mac shown below as examples:

Expected in: /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 15.0.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/SwiftUI.framework/SwiftUI
Expected in: [UUID omitted] /System/Library/Frameworks/SwiftUI.framework/Versions/A/SwiftUI

The complete stack trace is here.

Troubleshooting Steps

  • Removed all Swift Package Manager dependencies to isolate the issue.
  • The project runs successfully in Xcode 14.3.1.

Environment

  • macOS: 13.5.2
  • Xcode: 15.0 (also tried RC1)
  • Command Line Tools: 15.0.0.0.1.1694021235

Minimal Reproducible Example

// When built with Xcode 15.0, conforming to ShapeStyle results in a startup crash.
enum CrashAppOnStart: ShapeStyle {
    case iOS15Crashes
    case iOS16Crashes
    case macOS13Crashes
}

Profiling with the App Launch Instrument shows that execution stalls before hitting App.main(), contributing to the crash.

Has anyone experienced a similar issue or found a solution?

2

Answers


  1. You need to implemented func resolve(in environment: EnvironmentValues) -> Self.Resolved.
    New resolve function have been added since iOS17. Documentation

    Login or Signup to reply.
  2. Found a solution

    Implement func resolve(in environment: EnvironmentValues) -> Self.Resolved

    Updated example:

    enum CrashAppOnStart: ShapeStyle {
       case iOS15Crashes
       case iOS16Crashes
       case macOS13Crashes
    
       func resolve(in environment: EnvironmentValues) -> some ShapeStyle {
           Color.black
       }
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search