Search Unity

ARFoundation crashes when changing from AR scene to normal scene

Discussion in 'AR' started by enhawk, Oct 31, 2018.

  1. enhawk

    enhawk

    Joined:
    Aug 22, 2013
    Posts:
    833
    Only seems to affect iOS devices.

    Is there a way to stop this from happening?
     
  2. tdmowrer

    tdmowrer

    Joined:
    Apr 21, 2017
    Posts:
    605
    It's related to this issue. It happens the second time you disable the AR subsystems (this would happen after scene switching a couple of times). The fix is ready and working its way through QA. We should be able to release an update soon.
     
  3. enhawk

    enhawk

    Joined:
    Aug 22, 2013
    Posts:
    833
    ah, thanks!
     
  4. enhawk

    enhawk

    Joined:
    Aug 22, 2013
    Posts:
    833
    Was there an update on this? It's kind of a showstopper for us as with others commenting in that issue.

    When I leave an ARFoundation scene and go back in (game > titlescreen > game) AR flatout stops working and I get a bunch of errors in XCode about planemanager.

    Code (CSharp):
    1. NullReferenceException: A null value was found where an object instance was required.
    2.   at UnityEngine.MonoBehaviour.StartCoroutine (IEnumerator routine) [0x00000] in <filename unknown>:0
    3.   at System.Action`1[T].Invoke (.T obj) [0x00000] in <filename unknown>:0
    4.   at System.Action`1[T].Invoke (.T obj) [0x00000] in <filename unknown>:0
    5.   at System.Action`1[T].Invoke (.T obj) [0x00000] in <filename unknown>:0
    6.   at UnityEngine.XR.ARFoundation.ARSubsystemManager.OnPlaneAdded (PlaneAddedEventArgs eventArgs) [0x00000] in <filename unknown>:0
    7.   at System.Action`1[T].Invoke (.T obj) [0x00000] in <filename unknown>:0
    8.   at UnityEngine.Experimental.XR.XRPlaneSubsystem.InvokePlaneAddedEvent (BoundedPlane plane) [0x00000] in <filename unknown>:0
    9. (Filename: currently not available on il2cpp Line: -1)
     
    Last edited: Nov 22, 2018
  5. nilsdr

    nilsdr

    Joined:
    Oct 24, 2017
    Posts:
    374
    I don't think this is related. Are you unregistering from the planeadded event in ondisable?

    Code (CSharp):
    1. void OnDisable()
    2.         {
    3.             ARSubsystemManager.planeAdded -= OnPlaneAdded;
    4.         }
     
  6. enhawk

    enhawk

    Joined:
    Aug 22, 2013
    Posts:
    833
    thank you! All fixed