ARWorldTrackingConfiguration does not work when deployed from Xcode10 to iOS11 devices

496 Views Asked by At

working on a concept code based on ARWorldTrackingConfiguration. It seems not to work properly when deployed from Xcode10b1 on iOS11.4

Specifically the delegate:

func renderer(_ renderer: SCNSceneRenderer, nodeFor anchor: ARAnchor) -> SCNNode? 
{
   //relevant code here
}

is not called at all. The same code runs without any issue when deployed from Xcode9.4 on the same device. Also there isn't any issue when deploying on iOS12 from Xcode10. Below there is the relevant code used to configure and init the ARConfiguration.

func resetTrackingConfiguration() {
    guard let referenceImages = ARReferenceImage.referenceImages(inGroupNamed: "Photos", bundle: nil) else { return }

  var configuration:ARConfiguration!
    if #available(iOS 12.0, *) {
        configuration = ARImageTrackingConfiguration()
        (configuration as! ARImageTrackingConfiguration).trackingImages = referenceImages
        (configuration as! ARImageTrackingConfiguration).maximumNumberOfTrackedImages = referenceImages.count
    } else {
        configuration = ARWorldTrackingConfiguration()
        (configuration as! ARWorldTrackingConfiguration).detectionImages = referenceImages
    }

    let options: ARSession.RunOptions = [.resetTracking, .removeExistingAnchors]
    sceneView.session.run(configuration, options: options)
}
1

There are 1 best solutions below

0
On

Figured it out. Seems that Xcode10 suffers of a bug causing no resources loaded correctly. More Here