PTCInc / vuforia-engine

Bug and feedback issue tracker for the Vuforia Engine SDK
https://developer.vuforia.com
20 stars 0 forks source link

Missing Google Play Services for AR on Supported Device #156

Open josefgrunig opened 1 month ago

josefgrunig commented 1 month ago

Summarize the bug: Vuforia does not trigger the Google Play Services for AR install request on supported devices. The app is built with Unity for Android and ARCore is included as Optional; the affected device is a Xiaomi Mi 11 (supported by ARCore) but for some reason it's missing the Google Play Services for AR. Since the service is missing, Vuforia fallbacks on its internal tracking technology but the phone is not on the Vuforia's supported device list and fails detecting the Ground Plane.

Observed problem Vuforia does not trigger the Google Play Services for AR install request on supported devices

Expected result Even if ARCore is Optional included I expect Vuforia to check for ARCore supported devices and perform a request install of the library: https://developers.google.com/ar/develop/unity-arf/enable-arcore#perform_runtime_checks

Reproducible steps Steps to reproduce the behavior:

  1. Build the Vuforia Sample App and include Arcore as Optional
  2. Delete the Google Play Services for AR app
  3. Launch the sample and try detecting the ground plane on a Vuforia NON supported device like the Xiaomu Mi11

Affected Engine version: Vuforia: v10.21.3. Unity 2022.3.16f1 ARCore 1.36

Affected platform:

Affected device:

ptc-emaggio commented 1 month ago

Hi @josefgrunig thanks for the report. I can confirm that we do not trigger the request install by choice, we are indeed considering doing this and we are open to feedback. At the moment the only way to make sure ARCore is installed on the device is to make it REQUIRED, then the Playstore will install it at the same time as your app.

josefgrunig commented 1 month ago

Thank you @ptc-emaggio for the prompt reply,

making ARCore REQUIRED is not an option because the reason we choose Vuforia was to extend the Ground Plane detection on non ARCore supported devices and increase device compatibility. Making ARCore REQUIRED would let out a long list of Android devices supported by Vuforia.

Any reason Xiaomi MI 11 is not on the Vuforia Ground Plane support list?

I suggest to check for the ARCore support even if optionally included with ArCoreApk.checkAvailabilityAsync() and in case its supported to trigger the install with ArCoreApk.requestInstall()

this can maybe exposed with a proper API request on the Vuforia Engine

As a side node: even if ARCore is included as REQUIRED Vuforia needs to check for support and install because the user might delete the service at any time. Is this handled by the Vuforia library? The Doc states: https://developers.google.com/ar/develop/java/enable-arcore#check_if_google_play_services_for_ar_is_installed

Both AR Required and AR Optional apps must use ArCoreApk.requestInstall() before creating an ARCore session to check whether a compatible version of Google Play Services for AR is (still) installed and to ensure that all required ARCore device profile data has been downloaded.

ptc-emaggio commented 1 month ago

Thank you @josefgrunig for the comments.

We are on the same page and I confirm we are internally discussing the problem. Unfortunately I cannot promise a timeline for this change.

At the moment, for native (non Unity) development there is the option to issue the call in app code. For Unity development this should also be possible but it is more involved: you could use the DelayedInitalization option and then issue the Android call. Still, this is not something tried and tested.

Regarding the Xiaomi MI 11, in general we do not enable our own Ground Plane implementation on devices where Ground Plane is available via ARCore.

josefgrunig commented 1 month ago

Thank you @ptc-emaggio for pointing me in the right direction. I was able to add the ARCore Availability check and Install Request using a custom UnityPlayerActivity and adding there the functionality. I was already using the Vuforia's delayed init so I could perform the check before the actual session initialisation.

One last question, on ARCore unsupported devices Vuforia will fallback to its own Ground Plane implementation: is it possible to check if the device is supported or not by Vuforia at runtime, or even better ahead of the initialisation?

Thank you

ptc-epassaro commented 1 month ago

Hi @josefgrunig, in the case of Ground Plane, you can determine if it is supported using the active Fusion Provider. After Vuforia is initialized, you can call VuforiaRuntimeUtilities.GetActiveFusionProvider to know which Fusion Provider Type Vuforia is currently using on your device. Ground Plane will not be available if the Fusion Provider Type is VISION_ONLY.

You can read more about Vuforia Fusion here.

Unfortunately there is no way for Vuforia to know which Fusion Provider it can use before it is initialized, so if you call the method before initializing Vuforia, it will return UNKNOWN.