Unity-Technologies / arfoundation-samples

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

Checking for Device Support is invalid #388

Closed Leiong closed 4 years ago

Leiong commented 4 years ago

Unity:Unity2018.4.14f1 ARFoundation:1.50-preview.7 ARCoreXRPlugin:2.20-Preview.6 Device: MI 5

The check code is as follows:` public class MyComponent { IEnumerator Start() { if (ARSession.state == ARSessionState.None ||ARSession.stateARSessionState.CheckingAvailability) { yield return ARSession.CheckAvailability(); }

    if (ARSession.state == ARSessionState.Unsupported)
    {            
         Debug.Log("Unsupported");
        // Start some fallback experience for unsupported devices
    }
    else
    {
         Debug.Log("Supported");
        // Start the AR session
    }
}

} `

Leiong commented 4 years ago

0200102101955

MI5 phones do not support AR, but they cannot be checked out correctly. This is just an example. I also checked with other equipment. the problem still exists.

tdmowrer commented 4 years ago

This is the expected behavior when ARCore is "required" (the default). This is because you would not normally be able to install an ARCore required app on an unsupported device, so ARCore assumes if you are running an app that requires ARCore, then the device is supported. By building and deploying from Unity, you are "side loading" your apk and circumventing this restriction.

See also the ARCore docs on this. In the ARCore XR Plugin package, you can specify that ARCore is "optional" to support a fallback experience on unsupported devices.