Unity-Technologies / arfoundation-samples

Example content for Unity projects based on AR Foundation
Other
3.07k stars 1.15k forks source link

iOS app made with AR Foundation 4.0.2 & ARkit 4.0.2 does not set ARSessionState.CheckingAvailability status in Non ARkit supported devices and throws exception #552

Closed thesanketkale closed 4 years ago

thesanketkale commented 4 years ago

Unity bug report case number https://fogbugz.unity3d.com/default.asp?1264149_8dtnvld6pc620is9

Describe the bug
iOS app made with AR Foundation 4.0.2 & ARkit 4.0.2 does not set ARSessionState.CheckingAvailability status in Non-ARkit supported devices and at the start throws this exception in iOS app built with Unity 2019.4.3. Tested with iPhone 5s (ARkit not supported).

Exception:

NotSupportedException: Update requires a configuration.
  at UnityEngine.XR.ARKit.ARKitSessionSubsystem+ARKitProvider.Update (UnityEngine.XR.ARSubsystems.XRSessionUpdateParams updateParams) [0x00000] in <00000000000000000000000000000000>:0 
  at UnityEngine.XR.ARSubsystems.XRSessionSubsystem.Update (UnityEngine.XR.ARSubsystems.XRSessionUpdateParams updateParams) [0x00000] in <00000000000000000000000000000000>:0 
  at UnityEngine.XR.ARFoundation.ARSession.Update () [0x00000] in <00000000000000000000000000000000>:0

Trying with the iPad 6th Generation (ARkit supported) seems to work as expected with this configuration, but exception blocks gameplay in non-ARkit supported devices.

To Reproduce Steps to reproduce the behavior:

  1. Build the project submitted with the bug report to create an iOS app
  2. Install the app in iPhone 5s or 6 (ARkit not supported)
  3. Start the app
  4. See logs in Xcode for the exception

Expected behavior Upon starting the app, if the device is ARkit supported, it should start ARkit session and place a 3D cube in the world space 5 units away on the z-axis. If the device is not ARkit supported (like iPhone 5s or iPhone 6), it should start webcam texture in the background and place a 3D cube in the world space 5 units away on the z-axis.

Actual behavior Exception thrown in non-ARkit supported device (iPhone 5s): NotSupportedException: Update requires a configuration. at UnityEngine.XR.ARKit.ARKitSessionSubsystem+ARKitProvider.Update (UnityEngine.XR.ARSubsystems.XRSessionUpdateParams updateParams)

Smartphone:

tropicdragon commented 4 years ago

Can you confirm with me what version of iOS you have installed on your 5s phone ?

thesanketkale commented 4 years ago

Can you confirm with me what version of iOS you have installed on your 5s phone ?

Sure, my iPhone 5S is running iOS 12.4.7.

mdurand42 commented 4 years ago

Closing this Github issue since @thesanketkale was kind enough to open a Unity bug. I have assigned that bug to @tropicdragon.

It looks as though our code assumes that any phone capable of running iOS 11 was also capable of running ARKit and the iPhone 5S is an exception. We are actively looking into a fix and thanks again for opening the bug.

tdmowrer commented 4 years ago

This was fixed in 4.0.8