nalexn / ViewInspector

Runtime introspection and unit testing of SwiftUI views
MIT License
2.16k stars 148 forks source link

0.10.0 fails builds with assumeIsolated(_:file:line:)' is only available in iOS 17.0 or newer error #333

Open NishanthReddyKuninti opened 1 week ago

NishanthReddyKuninti commented 1 week ago
- ERROR | [iOS] xcodebuild:  ViewInspector/Sources/ViewInspector/SwiftUI/CustomView.swift:162:30: error: 'assumeIsolated(_:file:line:)' is only available in iOS 17.0 or newer
manishkumar03 commented 1 week ago

Getting the same error.

❌ /Users/jenkins/builds-runner-8/work/iOS/iOS/acv-ios-unit-test-dd/SourcePackages/checkouts/ViewInspector/Sources/ViewInspector/SwiftUI/CustomView.swift:153:30: 'assumeIsolated(:file:line:)' is only available in iOS 17.0 or newer return try MainActor.assumeIsolated {

nalexn commented 1 week ago

Which Xcode are you using?

For Xcode 16 it is defined like that:

@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
    public static func assumeIsolated<T>(_ operation: @MainActor () throws -> T, file: StaticString = #fileID, line: UInt = #line) rethrows -> T where T : Sendable
liambrozik commented 1 week ago

Getting the same issue on XCode 15.2 in Azure pipelines

nalexn commented 1 week ago

Well, I guess you need to either use a newer Xcode (15.4 might work), as there is no way to avoid assumeIsolated and support newest features

liambrozik commented 1 week ago

Xcode 15.4 did work

fangmobile commented 1 week ago

Confirming changing to 15.4 works for me.