ARKit Plane Detection - Value of type 'ARView' has no member 'session'

You get this error if your build destination is set to a Simulator. You need to select either an Actual Device or Generic iOS Device.

I've banged my head on this a couple of time and now add the following comment

    // If the following line fails to compile "Value of type 'ARView' has no member 'session'"
    // You need to select a Real Device or Generic iOS Device and not a simulator
    arView.session.run(configuration)

If you use iOS Simulator for AR app based on Interface Builder Storyboard or if you use iOS SwiftUI Preview – then you can't implement session-oriented properties and anchoring components for ARView. As you can see there are a lot of errors in this case.

When Simulator is chosen in Xcode Active Scheme.

enter image description here


The only way to use session-oriented properties for your AR app is to choose a real iOS or iPadOS device in the Xcode Active Scheme drop-down menu.

When real Apple device is chosen for build.

enter image description here


The same is true for installGestures() method

iOS Simulator:

enter image description here

Real Device:

enter image description here