0

I participate in the Catalina and Xcode beta test program.

Some weeks ago, I was working with a simple macOS Cocoa/SwiftUI app (not smartphone as most users do). Yesterday it just stopped working and crashed instead. This can of course happen for a beta tester, but I am a bit surprised and annoyed about this, because it prevents me for going on. And I don't understand why it suddenly just don't work anymore.

To go more into detailed. The error is very easy to reproduce:

  1. Create a new Cocoa/SwiftUI project
  2. Add a @State variable to the ContentView
  3. Add a Toggle view to the ContentView's body
  4. Bind the @State variable to the Toggle
  5. Run

It then crashes immediately (not when clicking the Toggle, but when run).

Hope someone can verified this for me. Especially that it is not a fault on my installation/system, but in the latest beta software.

I am running Xcode Version: 11.0 beta 2 (11M337n). And Catalina version 10.15 Beta (19A501i).

To solve the problem, I have tried to clean the build folders.

The code below produces the error, although not using a Toggle, but a TabbedView.

import SwiftUI  

struct ContentView : View  
{  
    @State var selection: Int = 1  

    var body: some View  
    {  
        TabbedView(selection: $selection)  
        {  
            Text("Tab 1!").tabItemLabel(Text("Tab 1")).tag(1)  
            Text("Tab 2!").tabItemLabel(Text("Tab 2")).tag(2)  
        }  
    }  
}  

Log in output window when it crash:

dyld: lazy symbol binding failed: Symbol not found: _$s7SwiftUI5StateV13delegateValueAA7BindingVyxGvg Referenced from: /Users/asl/Library/Developer/Xcode/DerivedData/aaa-byucivzkosyehgdhjnjxicgrjnbi/Build/Products/Debug/aaa.app/Contents/MacOS/aaa Expected in: /System/Library/Frameworks/SwiftUI.framework/Versions/A/SwiftUI

dyld: Symbol not found: _$s7SwiftUI5StateV13delegateValueAA7BindingVyxGvg Referenced from: /Users/asl/Library/Developer/Xcode/DerivedData/aaa-byucivzkosyehgdhjnjxicgrjnbi/Build/Products/Debug/aaa.app/Contents/MacOS/aaa Expected in: /System/Library/Frameworks/SwiftUI.framework/Versions/A/SwiftUI

Developer-1
  • 163
  • 8
  • Try a search on "[swiftui] Catalina". It may not work, but I remember a question... about 3 days ago? Be it an answer or a comment, it said something about iPad apps using Catalyst to work in Catalina aren't working.I thought it related to beta 3 and it may not be *your* situation, but it was in the Xcode release notes. –  Jul 14 '19 at 18:30
  • Found it. Doesn't appear to be your issue, but it still may be worth a look. https://stackoverflow.com/questions/56967198/xcode-11-beta-3-build-error-unknown-attribute-state-use-of-undeclared-typ –  Jul 14 '19 at 18:32
  • 1
    Final thought. Beta 3, which has been out for almost 2 weeks (I expect beta 4 in about 24 hours) may fix it. Why not give it a try? –  Jul 14 '19 at 18:41
  • I was my opinion that Xcode was updated automatically, when auto-update was enabled in the System Settings. But it seems not to be true. As mentioned, the code was running all right a week ago. And I thought this had to do with Xcode was updated auto, without me being noticed. I have now just started to download the new Xcode beta3, and I hopes this will bring some changes. A lot of thanks for reminding me about the new Xcode Beta3. – Developer-1 Jul 14 '19 at 21:00
  • Yeah. Last year my iOS device *did* upgrade automatically. (Never tried Xcode.) This year? Hit and miss. Almost two weeks ago I checked manually for beta 3 early afternoon Cupertino time and... no. Then a few hours later I saw on SO that it was available. My guess? Since there was so much new stuff (and you hit about three of them) for now it's best to recognize some things will break with a beta but hopefully more things get fixed. (As such, keep backups of your betas. If i knew 8-O (that's my best shot at a shocked expression) as you may lose some things. –  Jul 14 '19 at 21:33
  • Solved by beta3 - great. – Developer-1 Jul 15 '19 at 07:57
  • But we are still facing it, with latest `XCode 12.4` with `MacOS 11.1` SDK: `dyld: Symbol not found: _$s4Body7SwiftUI3AppPTl` – Top-Master Feb 18 '21 at 06:40

0 Answers0