You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Xcode's canvas won't preview SwiftUI view when adding SwiftCheck to the test target dependency.
Steps To Reproduce
From Xcode File > Swift Packages > Add Package Dependency add Swift Check. Select test target.
Go to ContentView.swift default template file.
Expected Result
Preview should build and show "Hello, World!"
Actual Result
Xcode fails to build preview.
However, Simulator runs fine.
Additional information
When I click 'diagnostics', it shows the following:
'disabled' is only available in iOS 10.0 or newer
----------------------------------------
SchemeBuildError: Failed to build the scheme "test"
Compile Swift source files:
warning: Could not read serialized diagnostics file: Invalid File: Invalid diagnostics signature (in target 'TSCBasic' from project 'swift-tools-support-core')
warning: Could not read serialized diagnostics file: Invalid File: Invalid diagnostics signature (in target 'TSCBasic' from project 'swift-tools-support-core')
warning: Could not read serialized diagnostics file: Invalid File: Invalid diagnostics signature (in target 'TSCBasic' from project 'swift-tools-support-core')
warning: Could not read serialized diagnostics file: Invalid File: Invalid diagnostics signature (in target 'TSCBasic' from project 'swift-tools-support-core')
Compile /Users/jay/Library/Developer/Xcode/DerivedData/test-fuoxsdzrmdjcfdbltcfeaqoxrdxv/SourcePackages/checkouts/swift-tools-support-core/Sources/TSCBasic/OSLog.swift:
/Users/jay/Library/Developer/Xcode/DerivedData/test-fuoxsdzrmdjcfdbltcfeaqoxrdxv/SourcePackages/checkouts/swift-tools-support-core/Sources/TSCBasic/OSLog.swift:52:35: error: 'disabled' is only available in iOS 10.0 or newer
return OSLog(os.OSLog.disabled)
^
/Users/jay/Library/Developer/Xcode/DerivedData/test-fuoxsdzrmdjcfdbltcfeaqoxrdxv/SourcePackages/checkouts/swift-tools-support-core/Sources/TSCBasic/OSLog.swift:52:35: note: add 'if #available' version check
return OSLog(os.OSLog.disabled)
^
...
The text was updated successfully, but these errors were encountered:
This happened because Xcode resolved the test packages of SwiftCheck as well. This is updated with Xcode 11.4 + tools version 5.2. I forked the repo and changed the version to 5.2, and voila, it worked like charm. I'm opening a pull request for this fix.
Version
077c096
Environment
macOS 10.15.4 + Xcode 11.4.1
Description
Xcode's canvas won't preview SwiftUI view when adding SwiftCheck to the test target dependency.
Steps To Reproduce
From Xcode File > Swift Packages > Add Package Dependency add Swift Check. Select test target.
Go to
ContentView.swift
default template file.Expected Result
Preview should build and show "Hello, World!"
Actual Result
Xcode fails to build preview.
However, Simulator runs fine.
Additional information
When I click 'diagnostics', it shows the following:
The text was updated successfully, but these errors were encountered: