Cannot preview visionOS apps because of Packages that do not support visionOS

https://developer.apple.com/forums/thread/731732 Possibly linked to the above issue

The app compiles just fine, but SwiftUI Previews cannot build if there any any packages that lack support for visionOS

I made sure that filters were enabled so that the package is only linked to iOS

In a project that literally NEVER imports or uses an iOS only package, it fails completely

== PREVIEW UPDATE ERROR:

SchemeBuildError: Failed to build the scheme ”VisionHelloWorld”

'tracks(withMediaType:)' is unavailable in visionOS

Compile LightCompressor.swift (arm64):
/Users/bryananderson/Library/Developer/Xcode/DerivedData/VisionHelloWorld-dviwzruidaouzeeafminiifghzfe/SourcePackages/checkouts/LightCompressor_iOS/Sources/LightCompressor/LightCompressor.swift:123:47: error: 'tracks(withMediaType:)' is unavailable in visionOS
            guard let videoTrack = videoAsset.tracks(withMediaType: AVMediaType.video).first else {
                                              ^~~~~~
AVFoundation.AVAsset:17:15: note: 'tracks(withMediaType:)' has been explicitly marked unavailable here
    open func tracks(withMediaType mediaType: AVMediaType) -> [AVAssetTrack]

Replies

LightCompressor only supports iOS and tvOS. visionOS support will have to be requested from the maintainers of the project hence no symbols for visionOS unless the app is made for iPad.

Right. So I specifically am not using it in visionOS. It's just a sample package. I have 5 or so that cannot be used on visionOS. The app builds fine. I've put in the necessary #if os(iOS) and #if canImport(Etc)

The problem is with SwiftUI previews. Not with a package.