Build Vision Pro failed

`error: [xrsimulator] Component Compatibility: EnvironmentLightingConfiguration not available for 'xros 1.0', please update 'platforms' array in Package.swift error: [xrsimulator] Exception thrown during compile: compileFailedBecause(reason: "compatibility faults") error: Tool exited with code 1

Hi @SteveAcc ,

It's not clear what's really happening here without more context. However, I think if you update the platforms block in your reality kit content's Package.swift file to look something like this:

let package = Package(
name: "RealityKitContent",
platforms: [
.visionOS(.v2),
.macOS(.v15),
.iOS(.v18)
],

it might clear up this issue.

Hi, thanks for your answer. However, it's still not working. To provide more context: I'm running an experiment on Vision Pro, and when I add the "EnvironmentLightingConfiguration" component in Reality Composer, my build fails (no issues before adding the "EnvironmentLightingConfiguration" component).

I'm using VisionOS 2.0, and I believe I don't need macOS or iOS for this project. When I open the Package.swift file, there's no platform block, and when I add the block you mentioned, I get an error: "v2 is unavailable."

Hey @SteveAcc,

Could you try upgrading to your PackageDescription to 6.0, this is when the .v2 version was made first available. I think this may fix this issue.

// swift-tools-version:6.0

Let me know if this works,
Michael

Workaround:

I tried adding the platforms: [.visionOS(.v2)] and updating the PackageDescription to swift-tools-version:6.0 but no luck.

I was able to get visionOS 2.0 features working by adding it programmatically under the RealityView's update: {}. For example, to add the BillboardComponent, just add it directly in the code and not in Reality Composer Pro scene/project.

entity.components.set(BillboardComponent())

I suspect the same will work for EnvironmentLightingConfiguration.

Good luck!

We have previous compiled for visionOS 2.0 no problem but now using Xcode 26 (beta 2) we're getting errors in Package.swift.

Updating swift-tools-version to 6.0 and the platform to .visionOS(.v2) didn't do anything an in fact the compiler suggests .v2 doesn't exist as an option.

The real issue turned out to be an outdated Light component in one of our models in our Reality Composer Pro assets bundle that I only found by deleting half our models in the bundle, attempting to compile, and repeating ad nauseam.

Build Vision Pro failed
 
 
Q