ARKit Session Not Resuming After Changing Screen

In my ARKit app When I close the ARSCNView and go back to the ARSCNView then I find out that the session is paused due to this code:

override func viewWillDisappear(_ animated: Bool)
{
super.viewWillDisappear(animated)
// Pause the view's session
sceneView.session.pause()
}

When I close the ARSCNView and go back to ARSCNView screen the app gets Crashed because of this code :

super.viewWillAppear(animated)
// Create a session configuration
let configuration = ARWorldTrackingSessionConfiguration()
// Run the view's session
sceneView.session.run(configuration)
}

But this code never resumes the session. The screen is completely frozen.. Anyone can help me out?

Hello,

It sounds like maybe your session is failing when you try to re-run. Are you receiving anything in the session(_:didFailWithError:) delegate method?

ARKit Session Not Resuming After Changing Screen
 
 
Q