Azure / azure-spatial-anchors-samples

Azure Spatial Anchors sample code
Other
293 stars 138 forks source link

Missing latest Google Play Services for AR on Google Pixel 2 XL running Android 11 #223

Closed TobiasPott closed 3 years ago

TobiasPott commented 3 years ago

Description

An error occurs when running an app using ASA on an Pixel 2 XL device running Android 11 (with security patch of 5th Oct. 2020) which tells me that the app requires the latest Google Play Services for AR although the latest version is installed and no update is available from play store. This error shows up for our custom application using ASA and running the sample project for Azure Spatial Anchors using the latest version of ASA SDK (2.6.0) from UPM. I can ignore the message and skip the warning but the sample app is limited in its functionality and behaviour. The sample app does not show a camera stream but instead only solid black screen.

The error is not displayed on other AR based applications (using only and older versions ARCore or Unity ARFoundation) nor is it displayed when running Minecraft Earth (the only public available app I know using ASA).

Steps to reproduce the issue

  1. You need a device running Android 11 (in my case a Google Pixel 2 XL)
  2. Download and build the sample Unity project to said device
  3. Start the sample app and select one of the demos to initialise ASA and the error should show up.

Expected behavior

No warning/message about missing latest Google Play Services for AR and the running app should show a camera stream.

Screenshots

Screenshot_20201021-183216

Development information (please complete the following information)

AR Device information (please complete the following information):

Additional context

I'm unsure whether this issue is related to ASA solely or at all as this message showed up earlier this year when using the google model viewer (https://modelviewer.dev) on the same (and other devices) but on a different Android version.

Edit: The issue does not occur when using an iOS device or a different Android device running Android 10 (Motorola Moto g7)

craigktreasure commented 3 years ago

I don't believe this is related to ASA. You should get updates for "Google Play Services for AR" from the Google Play store. My Google Pixel 2 (yes, I'm due for an upgrade) says i'm running version 1.20.202550203, which is consisted with the SDK releases.

TobiasPott commented 3 years ago

I don't believe this is related to ASA. You should get updates for "Google Play Services for AR" from the Google Play store. My Google Pixel 2 (yes, I'm due for an upgrade) says i'm running version 1.20.202550203, which is consisted with the SDK releases.

I'm running the same version of the play services for AR as you do and as I stated before and have uninstalled and reinstalled the latest version. So your advice to get an update for it is little to not helpful. But thank you for your advice. Screenshot_20201022-105323 (Downscaled screenshot)

rubit0 commented 3 years ago

You actually need to check in a coroutine at app start to make sure that ARCore support library is installed, consider this snippet:

    private IEnumerator CheckArAvailability()
    {
        while (ARSession.state == ARSessionState.None ||
               ARSession.state == ARSessionState.Installing ||
               ARSession.state == ARSessionState.CheckingAvailability)
        {
            yield return null;
        }

        if (ARSession.state == ARSessionState.NeedsInstall)
        {
            yield return ARSession.Install();
            HasARSupport = ARSession.state != ARSessionState.NeedsInstall;
        }
        else
        {
            HasARSupport = ARSession.state != ARSessionState.Unsupported;
        }
    }
TobiasPott commented 3 years ago

So you suggest I perform a check for a library I previously noted is already installed with its latest version? Just to understand you correctly as I got the impression that you did not read the complete thread and your suggestion does not help with the specific issue, as the Google Play Services for AR is not even removable from the Pixel devices and thus is always installed and can't 'miss'.

rubit0 commented 3 years ago

AFAIK ARSession.state == ARSessionState.NeedsInstall will be the case also when an Update is available.

Furthermore from my personal experience "on the field" I found out that some devices simply have a corrupted AR Services installation that can't be fixed, you can uninstall and reinstall again - AR Services stays broken. Huawei devices are especially prone to that but we also found out that german T-Mobile branded Android devices have this tendency as well.

Sorry that this might be not directly helpful for you and I recommend to also open up an Issue on Googles ARCore repository.

cmsrk commented 3 years ago

I have the same issue regarding the allegedly missing latest version of the Google Play Services for AR on a Xiaomi A3 running Android 11, my other AR apps are working, rolling back to version 1.20.202550203 of the AR services didn't work. I am using Unity 2019.4.14f1, ASA version 2.7.2 and Windows 10.

rubit0 commented 3 years ago

I have the same issue regarding the allegedly missing latest version of the Google Play Services for AR on a Xiaomi A3 running Android 11, my other AR apps are working, rolling back to version 1.20.202550203 of the AR services didn't work. I am using Unity 2019.4.14f1, ASA version 2.7.2 and Windows 10.

Have you looked into the code snippet I have posted?

cmsrk commented 3 years ago

I have the same issue regarding the allegedly missing latest version of the Google Play Services for AR on a Xiaomi A3 running Android 11, my other AR apps are working, rolling back to version 1.20.202550203 of the AR services didn't work. I am using Unity 2019.4.14f1, ASA version 2.7.2 and Windows 10.

Have you looked into the code snippet I have posted?

Yes, unfortunately this is not solving the problem. It's also not a general issue with ARCore, as other AR apps are working fine.

msftradford commented 3 years ago

Hello @TobiasPott and @chrismasz thanks for reaching out. We've been having a tough time reproducing this issue on our different Android devices and Android OS versions. @chrismasz, does the same issue occur with the ASA sample app as well? I've opened an internal issue (#31806584) to keep track of our progress. If you have additional details that can help us repro, that would be helpful. Thanks!

Mann1ng commented 3 years ago

Hi, I'm also experiencing this issue on a Pixel 2. The above information has been attempted without success. I'm just wondering if this issue has been addressed since Feb 23, 2021? Many thanks.

oafolabi-msft commented 3 years ago

@Mann1ng, by "the above information", are you referring to a check to see if the same issue occurs with ASA sample app as well?

no-response[bot] commented 3 years ago

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.