2 Replies
      Latest reply: Jan 2, 2018 2:02 PM by Bobjt RSS
      swissdev Level 1 Level 1 (0 points)

        Hi

         

        We have a problem with our app when starting on an iPhone X.

        As soon as we run the ARKit Session with .gravityAndHeading on, it fails with:

         

        session did fail with error: Error Domain=com.apple.arkit.error Code=102 "Required sensor failed." UserInfo={NSLocalizedFailureReason=A sensor failed to deliver the required input., NSUnderlyingError=0x1d02415c0 {Error Domain=CMErrorDomain Code=102 "(null)"}, NSLocalizedRecoverySuggestion=Make sure that the application has the required privacy settings., NSLocalizedDescription=Required sensor failed.}

         

        If we only set it to .gravitiy. It works.

        What causes this issue. We have added all privacy flags and it still does not work.

         

        CoreLocation and the camera is accepted as well.

         

        We have a second iPhone X and it works there.

         

        Does anybody have the same issue?

        • Re: ARKit Error: A sensor failed 102
          peterdev Level 1 Level 1 (0 points)

          Same issue here on a iPhone 7 plus, no problems on a 5SE. workaround for me is:

           

              func session(_ session: ARSession, didFailWithError error: Error) {      

                  switch error.code {

                  case 102:

                      configuration.worldAlignment = .gravity

                      restartSessionWithoutDelete()

                  default:

                      restartSessionWithoutDelete()

                  }

              }

           

              @objc func restartSessionWithoutDelete() {

                  self.sceneView.session.pause()

                  self.sceneView.session.run(configuration, options: [

                      .resetTracking,

                      .removeExistingAnchors])

              }

          • Re: ARKit Error: A sensor failed 102
            Bobjt Apple Staff Apple Staff (70 points)

            Did this error start after iOS 11.2? There was bug fixed in 11.2 so that Core Location more accurately reports heading availability. This would mean that you wouldn't receive the ARSession error prior to 11.2, but would still not get a pose (because, heading isn't available). What would help the Core Location team diagnose this problem is if you could file a bug report and include an iOS sysdiagnose (scroll down the list here to find steps to do this).