Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Preview throwing error in SwiftUI: ConfigurationError: noPreviewInfos

Tags:

ios

swift

swiftui

I am using Xcode 12.4 in macOS Catalina 10.15.7 version. While preview SwiftUI code:

import SwiftUI
struct SwiftUINewView: View {
    var body: some View {
        Text("Ayush Gupta")
    }
}

struct SwiftUINewView_Previews: PreviewProvider {
    static var previews: some View {
        SwiftUINewView()
    }
}

I am getting error:

ConfigurationError: noPreviewInfos(arch: "x86_64", sdkRoot: "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk")

Is there any solution for this issue? Actually I am trying to integrate SwiftUI in old/existing UIKit project which is now supporting iOS 13.0 SDK.

like image 326
Ayush Gupta Avatar asked May 01 '21 07:05

Ayush Gupta


1 Answers

I have a solution that is perfectly working fine for me.

Go to Editor -> Canvas -> Disable/Uncheck "Automatically Refresh Canvas"

enter image description here

like image 72
Ayush Gupta Avatar answered Oct 23 '22 03:10

Ayush Gupta