SwiftUI view and BodyTrackedEntity

In my project I have a SwiftUI that embeds the UIViewController for the body tracking example. This all compiles and runs fine on my iPad.


However in my project I have other SwiftUI views. When I am trying to view them in the SwiftUI preview window (I am also on Catalina 10.15 beta 3) it is not able to display this view, even though it has absolutely nothing to do with the BodyTracking example it still complains about this file and displays the message "Use of undeclared type 'BodyTrackedEntity' ".


I have even commented out the PreviewProvider for the BodyTracking view and it still has this error.


My guess is that there is an issue with XCode 11 Beta 3 when trying to preview views it looks through every view and compiles all of them to see if they are correct, but it shoud only care about the one I have selected. Also it should know that the BodyTracking code won't work and simply ignore is warnings.


Anyone else having these kind of issues when trying to make a SwiftUI based project that uses RealityKit features?

Replies

I have the same issue. Although the Xcode is already not the beta version.

Hi.


Try setting the active scheme to "Build Only Device->Generic iOS Device" or plug and iPhone.

It does not work deploying in simulations.


Hope it works.