Unity-Technologies / arfoundation-samples

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

[Bug] ARSession CheckAvailability State is wrong #650

Closed weacw closed 3 years ago

weacw commented 4 years ago

Describe the bug When I use CheckAvailability on a device where Google Play Services for AR is not installed, the detected status is alwaysUnsupported instead of NeedInstall. The device is supported ARCore!

To Reproduce

public IEnumerator CheckAvailability()
{
   if ((ARSession.state == ARSessionState.None) ||
       (ARSession.state == ARSessionState.CheckingAvailability))
      {
          yield return ARSession.CheckAvailability();
      }

     Debug.Log($"Current AR Session State:{ARSession.state.ToString()}");
}

Log

I/native: arpresto_api.cc:30 ArPresto::ArPresto_initialize
I/native: arpresto_api.cc:77 ArPresto::ArPresto_checkApkAvailability
I/chatty: uid=10180(com.cell.test) UnityMain identical 14 lines
E/SchedPolicy: set_timerslack_ns write failed: Operation not permitted
W/ARCore-InstallService: bindService returned false.
E/ARCore-InstallService: Play Store install service could not be bound.

Smartphone (please complete the following information):

tdmowrer commented 4 years ago

Can you run this command and post the output here?

adb shell getprop ro.build.fingerprint

weacw commented 4 years ago

Can you run this command and post the output here?

adb shell getprop ro.build.fingerprint

Xiaomi/grus/grus:9/PKQ1.181121.001/V11.0.5.0.PFBCNXM:user/release-keys image

tdmowrer commented 4 years ago

Thanks; it looks like your device is indeed supported. The "Play Store install service could not be bound" error message sounds like an issue with the phone's app store. Is an app store disabled or not installed? What app store do you use on this device?

weacw commented 4 years ago

Thanks; it looks like your device is indeed supported. The "Play Store install service could not be bound" error message sounds like an issue with the phone's app store. Is an app store disabled or not installed? What app store do you use on this device?

Thank you for your reply. I can not install the Goolge Play Store because I'm in China. This device is using the Xiaomi app store(https://developers.google.com/ar/discover/supported-devices?hl=zh_cn#android_china). I don’t understand why I need to use the Play Store to check whether the ARCore service is installed?

tdmowrer commented 4 years ago

I don’t understand why I need to use the Play Store to check whether the ARCore service is installed?

You do not need the Google Play store, but you need an app store, and the Xiaomi app store should work.

As a sanity check, have your tried Google's ARCore plugin? If that plugin has the same problem, then please post an issue on their GitHub issues page, as that means it is an issue with the ARCore SDK. If it does not have the same problem, then we will consider a bug in Unity's implementation.

weacw commented 4 years ago

I don’t understand why I need to use the Play Store to check whether the ARCore service is installed?

You do not need the Google Play store, but you need an app store, and the Xiaomi app store should work.

As a sanity check, have your tried Google's ARCore plugin? If that plugin has the same problem, then please post an issue on their GitHub issues page, as that means it is an issue with the ARCore SDK. If it does not have the same problem, then we will consider a bug in Unity's implementation.

Thank you. Next I'll try Google's ARCore plugin.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

4litasci-roofstacks commented 2 years ago

Make sure your ARCore and ARKit Requirements are optional. It might be thinks your device is supported because you select requirement as "Required" Ideally you should not install apk to unsupported device and it shows you wrong information.

Screen Shot 2022-06-16 at 10 17 06