arcore-android-sdk icon indicating copy to clipboard operation
arcore-android-sdk copied to clipboard

ArCoreApk_checkAvailability keeps returning AR_AVAILABILITY_UNKNOWN_CHECKING if the user hasn't installed ARCore and doesn't log in to google account

Open spicyPoke opened this issue 6 years ago • 6 comments

Hello, I just spot a minor issue. As the title stated, it keeps returning AR_AVAILABILITY_UNKNOWN_CHECKING if the user doesn't log in to the google account. In my case it makes the button that leads to AR Session never shows up. Any advice on how to tell user that his/her device is actually supporting ARCore, and the problem is because they haven't log in?

Thank you for your support.

spicyPoke avatar Apr 30 '18 10:04 spicyPoke

Good catch. At least we should return UNKNOWN_TIMED_OUT after a while.

Under the hood, our compatibility check works by checking for the visibility of ARCore itself. Without a signed-in account, there's not much we can do.

inio avatar Apr 30 '18 17:04 inio

Thank you for your response :). Looking forward for the fix, maybe I can think of some way to tell the user if UNKNOWN_TIMED_OUT is returned.

spicyPoke avatar May 04 '18 09:05 spicyPoke

In general the checkAvailability() API should not produce any user-facing side-effects except for enabling AR-entering user interface elements when the device is supported. The additional state is provided to provide some assistance in debugging why an UNSUPPORTED or UNKNOWN code is being returned when SUPPORTED is expected.

inio avatar May 04 '18 17:05 inio

Continuing on this issue, Does that mean if the user is not logged in to Google, the device could never be checked if it is supporting ARCore even if we use supported device?

AndreCahyaS avatar Jan 22 '19 04:01 AndreCahyaS

@AndreCahyaS Correct, current behavior for users who are not signed in (typically a development device that was just factory reset), your app will get AR_AVAILABILITY_UNKNOWN_CHECKING even though ARCore is not actually able to check anything until the user logs in.

UNKNOWN_TIMED_OUT would be a better response in this case, but the resolution is the same: let the user know that "Google Play Services for AR" is not installed and needs to be.

fredsa avatar Sep 24 '19 21:09 fredsa

Do you mean that AR_AVAILABILITY_UNKNOWN_CHECKING will be returned forever in this case? That means that on a device on which the user is not logged in to Google, the application will never know when to stop checking for availability because the API always returns that it is "still checking".

If this assumption is correct, this suspending function will never terminate in this case.

suspend fun ArCoreApk.getAvailability(context: Context): ArCoreApk.Availability {
    var result = checkAvailability(context)
    while(result.isTransient) {
        delay(200)
        result = checkAvailability(context)
    }
    return result
}

Can you confirm this? If this is not addressed (by returning a different code), I'd suggest to change the documentation to mention that AR_AVAILABILITY_UNKNOWN_CHECKING (i.e. UNKNOWN_CHECKING in Java) can also mean that the user is not logged in.

westnordost avatar Feb 06 '22 12:02 westnordost