EnvironmentResource.generate(fromEquirectangular:) does not compile with Xcode 16.0 beta 2

Hi!

It seems that Xcode 16 beta 2 thinks that EnvironmentResource.generate(fromEquirectangular:) is unavailable even when the minimum target remains set to visionOS 1.0 (it is deprecated but Xcode reports a build error). The only way I was able to keep this in place for visionOS 1.x while compiling with Xcode 16 was the following:

        var environment: EnvironmentResource?
        if #available(visionOS 2.0, *) {
            environment = try? await EnvironmentResource(equirectangular: skyBoxWithSun())
        } else {
            fatalError("EnvironmentResource.generate(fromEquirectangular:) does not compile with Xcode 16.0 beta 2.")
        }
        #else
        let environment = try? await EnvironmentResource.generate(fromEquirectangular: skyBoxWithSun())
        #endif

This will build with both Xcode 15.4 and 16 beta 2, but obviously crash when built with Xcode 16 and run on visionOS 1.x Do I have any better options? I would like to add some visionOS 2.0 features (e.g. try to replace my custom skybox with the new dynamic lighting) but prefer to maintain backward compatibility for now.

Still happens with Xcode 16 beta 3

EnvironmentResource.generate(fromEquirectangular:) does not compile with Xcode 16.0 beta 2
 
 
Q