简体   繁体   中英

ARWorldTrackingConfiguration does not work when deployed from Xcode10 to iOS11 devices

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)
}

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM