Very simple Cocoa/SwiftUI app suddenly doesn't work anymore

A couple of weeks ago, I made my first litte Xcode project using SwiftUI.


The ContentView is just a simple TabbedView using binding/state variable to select a tab.


Code look like this:


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)
        }
    }
}


Back then, when I first made the project, it was running fine.


Now, it just crashes consistently with the log:


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


I have cleaned build folders, but nothing helps.


Auto update is on, so I am running the latest version of Xcode and Catalina.


Thanks in advance for any help.

Does it crash or doesn't it compile ?


I have seen in tutorials that selection is declared private (I don't think that should change anything, but…)

It chrashes.


I have tried to change the code, but without any luck.


Furthermore, a couple of hours ago, I tried the same in an iOS application with no problems.

Very simple Cocoa/SwiftUI app suddenly doesn't work anymore
 
 
Q