Build errors for iOS for my visionOS app

I'm taking my iOS/iPadOS app and converting it so it runs on visionOS. I’m trying to compile my app, build it, for both visionOS and iOS. When I try to build for an iPhone and iPad simulator, I get the following error:

 Building for 'iphonesimulator', but realitytool only supports [xros, xrsimulator]

I’m thinking I might need to do a # if conditional compilation statement for visionOS so iOS doesn’t try to build lines of code but I can’t for this particular error find out for which file or code I need to do the conditional compilation. Anyone know how to get rid of this error? 

Answered by DTS Engineer in 788154022

Reality Composer Pro packages are only supported on visionOS, for a multi-platform app, you can set a platform filter (on the "General" settings pane of the multi-platform target) so that the Reality Composer Pro package is only built when building the target for visionOS:

Accepted Answer

Reality Composer Pro packages are only supported on visionOS, for a multi-platform app, you can set a platform filter (on the "General" settings pane of the multi-platform target) so that the Reality Composer Pro package is only built when building the target for visionOS:

Thanks so much @gchiste. That was the issue. Now working. It would be nice if the Developer Documentation page Bringing Your Existing Apps to VisionOS could be updated to address this situation more specifically. It vaguely mentions maybe having to adjust build configuration settings but does not address how to do what you show above, which I think would be a fairly common situation for developers converting their existing iOS, iPadOS apps to add visionOS functionality with RCP.

Build errors for iOS for my visionOS app
 
 
Q