So I've followed these steps for installing ARcore into Unity https://library.vuforia.com/content/vuforia-library/en/articles/Solution/arcore-with-vuforia.html But when I run it on a Samsung S9 and use this to test for it Code (CSharp): FusionProviderType trackerType = VuforiaRuntimeUtilities.GetActiveFusionProvider(); if (trackerType == FusionProviderType.PLATFORM_SENSOR_FUSION) return true; else return false; It always returns false. According to this information https://library.vuforia.com/articles/Solution/vuforia-fusion-supported-devices.html Samsung S9 SM-G960F should work. What else do I need to do? Unity version 2018.2.10f1 Vuforia 7.5.26 Android version 8.0.0 ARcore version 1.5.0 Latest Android SDK JDK jdk1.8.0_191.jdk NDK android-ndk-r13b
Hello, Are you making the call after Vuforia has been initialized? GetActiveFusionProvider() must be called after initializing Vuforia. If called before, it will return INVALID_OPERATION. Thanks, Vuforia Engine Support
Hello @monark, Another clarification. The table at https://library.vuforia.com/articles/Solution/vuforia-fusion-supported-devices.html represents the devices that support Vuforia VIO, not ARCore. I understand that this can be confusing, especially because there is an ARCore column. A more definitive link for ARCore supported devices can be found here: https://developers.google.com/ar/discover/supported-devices Thanks, Vuforia Engine Support
I've tested for it returning INVALID_OPERATION and it doesn't return that. https://developers.google.com/ar/discover/supported-devices Also contains the Samsung Galaxy S9
I've now built a test app that has nothing but a simple AR scene and a button that returns the response from GetActiveFusionProvider() Even though I can see a ground plane, so Vuforia is definitely up and running, if you tap the button the response is PLATFORM_SENSOR_FUSION false.
Hello, I did some testing today by modifying our Core Samples to add some additional logging. I updated GroundPlaneUI.cs as follows: Code (CSharp): #region VUFORIA_CALLBACKS void OnDevicePoseStatusChanged(Vuforia.TrackableBehaviour.Status status, Vuforia.TrackableBehaviour.StatusInfo statusInfo) { Debug.Log("OnDevicePoseStatusChanged(" + status + ", " + statusInfo + ")"); switch (statusInfo) { case Vuforia.TrackableBehaviour.StatusInfo.INITIALIZING: if (Vuforia.VuforiaRuntimeUtilities.GetActiveFusionProvider() == Vuforia.FusionProviderType.PLATFORM_SENSOR_FUSION) { m_TrackerStatus.text = "Initializing Tracker"; Debug.Log("GetActiveFusionProvider() == FusionProviderType.PLATFORM_SENSOR_FUSION"); } else { m_TrackerStatus.text = "Waiting for anchor to be placed to initialize"; Debug.Log("GetActiveFusionProvider() != FusionProviderType.PLATFORM_SENSOR_FUSION"); } break; case Vuforia.TrackableBehaviour.StatusInfo.UNKNOWN: if (Vuforia.VuforiaRuntimeUtilities.GetActiveFusionProvider() == Vuforia.FusionProviderType.PLATFORM_SENSOR_FUSION) { m_TrackerStatus.text = "Initializing Tracker"; Debug.Log("GetActiveFusionProvider() == FusionProviderType.PLATFORM_SENSOR_FUSION"); } else { m_TrackerStatus.text = "Waiting for anchor to be placed to initialize"; Debug.Log("GetActiveFusionProvider() != FusionProviderType.PLATFORM_SENSOR_FUSION"); } break; case Vuforia.TrackableBehaviour.StatusInfo.NORMAL: if (Vuforia.VuforiaRuntimeUtilities.GetActiveFusionProvider() == Vuforia.FusionProviderType.PLATFORM_SENSOR_FUSION) { m_TrackerStatus.text = "Tracking"; Debug.Log("GetActiveFusionProvider() == FusionProviderType.PLATFORM_SENSOR_FUSION"); } break; When running this on a similar Android device, I see the following messages on ADB: 11-14 11:00:40.881 11928 11944 I Unity : OnDevicePoseStatusChanged(DEGRADED, UNKNOWN) 11-14 11:00:40.885 11928 11944 I Unity : GetActiveFusionProvider() == FusionProviderType.PLATFORM_SENSOR_FUSION 11-14 11:00:41.333 11928 11944 I Unity : OnDevicePoseStatusChanged(TRACKED, NORMAL) 11-14 11:00:41.333 11928 11944 I Unity : GetActiveFusionProvider() == FusionProviderType.PLATFORM_SENSOR_FUSION This indicates to me that Vuforia is accurately detecting support for ARCore, and is returning the appropriate values on test of FusionProviderType.PLATFORM_SENSOR_FUSION. Here is a table that maps the return values of TrackableBehaviour.Status and TrackableBehaviour.StatusInfo: https://library.vuforia.com/content/vuforia-library/en/articles/Solution/tracking-state.html My understanding is that we are revisiting these return values in an upcoming release to make them more homogeneous between provider platforms (ARKit, ARCore, Vuforia VIO) and useful for developers. Thanks, Vuforia Engine Support
Well I sent off a test project to Unity as I couldn't see a way to do that on your own support site, I'm hoping you guys talk to each other. It does nothing other than add a ground plane and AR camera and then has a UI button to return the status of GetActiveFusionProvider() when you tap it. On my S9 that consistently returns false for FusionProviderType.PLATFORM_SENSOR_FUSION I don't know if there is something else I'm missing in the setup to get this working but that project shows what I'm actually doing. My assumption according to your help pages is that I don't need to do anything with the manifest as it doesn't say to do anything for Unity other than add the core plugin. Maybe something else needs to be done to get Vuforia to recognise ARcore support?
Hello @monark, Using the Unity Vuforia Core Samples, I was able to create an APK that ran on a Galaxy S8 and detect ARCore. I decrypted that APK with apktool and found the following line in the manifest file: <meta-data android:name="com.google.ar.core" android:value="optional"/> This is the same as what has been spelled out in the native Android requirements: https://library.vuforia.com/content/vuforia-library/en/articles/Solution/arcore-with-vuforia.html Thus, for me, the recommended Unity workflow in the article behaves as expected. I'm at a loss for why you're experiencing something different. Thanks, Vuforia Engine Support
Ah ok maybe there's the issue then. When I build an app from scratch this is the manifest I get. That line you have doesn't appear. Could that be it? Are we meant to add that manually, does your help need updating? This only talks about adding that line for native apps https://library.vuforia.com/content/vuforia-library/en/articles/Solution/arcore-with-vuforia.html
Adding that line in manually doesn't appear to solve the issue either. I can see it in the built manifest but I still don't get FusionProviderType.PLATFORM_SENSOR_FUSION returning true.
Is there a problem with this line extracted from the manifest? <meta-data android:name="com.google.ar.core.min_apk_version" android:value="180815000" /> Should that value not be android:value="19" ? [edit] I think that value is actually correct. So it's something else.
Hey @monark , have you installed the "ARCore by Google" from Google Play? Vuforia will only use it if it was previously installed.
Ah! that's it. Why on earth doesn't it say to do that in the help??? Thank you, thank you, thank you.
So how do you handle that with actual app users? I had assumed including it in the plugin directory was enough. Do you detect if it's missing and request users manually install it? Can you make it a requirement of the app so they are prompted to install it? Seems like a bit of a missing link, how would they know. I had no clue you needed to install it independently I assumed it was like iOS and installed with the Android OS.
Hello @monark, Google's decision to package ARCore separately (instead of including it as part of Android OS) has made challenging for Vuforia to properly package support in our samples.Thus, rather than create an ARCore dependency upon our samples (where ARCore can be updated at any time without warning for Vuforia), we took the decision to *not* package it with our samples. The AAR file, as mentioned in documentation, is used to allow the app to connect to the ARCore service on the device (if available), and it contains the functionality to download it - after user consent - to install the service at runtime of the app, if the device is supported. Apologies for the challenges you faced in getting this issue resolved. The fact that you list the ARCore version in your original post misled me to think it was already installed on the device. Thanks to @lrb for the practical suggestion. I'll review our documentation again to see if there are improvements to emphasize that ARCore must be installed on the device. Thanks, Vuforia Engine Support
I've now included a message to the user to manually install it if the app fails to detect it. I'm guessing that's best practice in this instance. But yes it would be good to detail this in the Unity getting started guide.
So I've upgraded my project to Unity 2018.2.12 and Vuforia 8.0 and even with AR core installed this has gone back to returning false again. Is there now some new trick to get it to work?
Hello @monark, There have been no recent changes to Vuforia Fusion, and we are not aware of any bugs with our integration with ARCore. We can investigate further with more information: Device model: Settings->About phone/device->Model number Device OS version ARCore version If possible, please be specific about which API call is returning an unexpected "false" value. Thanks, Vuforia Engine Support
I'm trying to put put together a simple test case, but I this is the bit of code that appears to not be working any more for me Code (CSharp): bool IsSupportedArCore() { #if UNITY_EDITOR return true; #endif //is this active at this point? FusionProviderType trackerType = VuforiaRuntimeUtilities.GetActiveFusionProvider(); if (trackerType == FusionProviderType.INVALID_OPERATION ) return false; else if (trackerType == FusionProviderType.PLATFORM_SENSOR_FUSION) return true; else return false; } Device's are Samsung S9 - Android 9 Huawei P20 - Android 8.1.0 A simple test scene has been reported to Unity as (Case 1175240) I don't know if you have access to that? But basically it's literally a button that calls the above function and displays the result. Unity 2018.2.12 Vuforia 8.0 ARcore 1.5.0
So some more information on this in U2018.4.5 with Vuforia 8.3.8 in the Vuforia configuration if I set ARcore requirement = REQUIRED or OPTIONAL and build with Gradle I can get that function to work in a simple test app. Unfortunately my actual project is in U2018.2.12 with 8.0 and that option in Vuforia config isn't available. Upgrading to 2018.4.5 causes a whole heap of other issues in my real project and doesn't seem to fix the problem either.... total nightmare. U2018.4.5 - Gradle won't build, gestures fail and Vuforia doesn't detect AR core.
Ok I've figured it out. Basically Vuforia doesn't work in 2018.2.12 with ARM64 as the build target. If I build to ARMv7 only then it works. This is an issue though as Google Play are now requiring that new builds have ARM64 support
Hello @monark, Support for Android 64-bit builds was added in 8.1.7. What is not clear to me is the relationship between the Engine installation components, and what the Unity Editor requires to create different build types. I know that some devs have had success installing newer versions of Vuforia Engine with older (and unsupported) versions of the Unity Editor, but I am not clear if the combinations you're using will work as they have not been tested by our team. Thanks, Vuforia Engine Support
There appears to be no option in 2018.2 to install any version of Vuforia beyond 8.0 Unity don't support anything below 2018.4 now so my only option is to upgrade to a build where Vuforia works and then fix all the issues that creates with everything else...
...and having done all that, it still fails. I can get my simple test case to work. But for my actual project it can't detect AR core even for ARMv7 now. Unity 2018.4.6 Build system Internal (Still can't get Gradle building to work) Vuforia 8.3.8 Phone S9 Android v9 The only difference is that in my simple case Vuforia is used in the first scene. In my real project I don't load the Vuforia scene till later in the process. However this used to work fine right up til 2018.2
I finally had success with this combination Unity 2018.4.6 Vuforia 8.3.8 Core-1.11.0 NDK 16b Internal build system Manually add <meta-data android:name="com.google.ar.core" android:value="optional" /> to the manifest
Unfortunately although this does "work" it's also adding the dreaded READ_PHONE_STATE to the manifest which is next to impossible to remove. So the saga continues...
Ok so I may have a new combination that works... Unity 2018.3.14f2 Vuforia 8.1.7 (which comes as the default for that build) Core-1.11.0 NDK 16b Internal build system No need to modify the manifest and it doesn't add READ_PHONE_STATE Also the video pass through works. What it doesn't do is request permission for access to external storage, which I happen to need for saving images, but I believe there is a fix for that...
Not working for me, always returning INVALID_OPERATION Unity 2019.2.5 Vuforia 8.3.8 arcore 12 macos high sierra 10.13.6 But the ground plane works, the GetActiveFusionProvider that is broken
I just found out that if I select OPTIONAL again on vuforiaconfiguration.asset just before I build the app, it works. I don't know if it is because I am using some defined symbols and changing it all the time through editor scripts that is causing this, but I have tested it multiple times, and if I click on OPTIONAL and select it again, it just works
Ok, I built the app, deployed on my s9 and it worked, so I uploaded the app to the store, and then downloaded it back on the s9 but it didn't work.
Hi @badjano, Could you please confirm the phone model you are using? and the OS? Thank you. Vuforia Engine Support