arcore-unity-extensions
arcore-unity-extensions copied to clipboard
`AREarthManager.IsGeospatialModeSupported()` always returns `FeatureSupported.Unknown` on fresh install
Hi, I'm building an iOS application using the Geospatial feature on Unity and, even though I've followed this guide and could make the given sample work, I have an issue when trying to make it work in my app:
After getting camera and location permissions on the iOS side, I check unity-side for AREarthManager.IsGeospatialModeSupported(GeospatialMode.Enabled)
before starting my logic but I constantly get FeatureSupported.Unknown
.. This happens no matter how long I let the app run (I check it at every Update).
However the strange thing is that the same IsGeospatialModeSupported()
method returns FeatureSupported.Supported
without issues from the very first check if I close and restart the app.
Not sure if it is clear, but on a fresh install where I need to wait for camera&location permissions I have the infinite FeatureSupported.Unknown
but not if I restart the app having already agreed to give those permissions.
Also note that I only start the Unity logic after the native-side has properly received the permissions, so for me it shouldn't be related to permissions but something else?
Any help is welcome :) Let me know if you need additional details.
Claudio
Here is a simplified version of my class btw:
public class GeospatialController : MonoBehaviour
{
public ARCoreExtensions ARCoreExtensions;
public AREarthManager AREarthManager;
// iOS native code calls this method after having received camera and location permissions.
public void AfterPermissionsGranted()
{
// Set fields of ARCoreExtensions that couldn't be directly linked in the inspector.
ARCoreExtensions.Session = FindObjectOfType<Session>();
ARCoreExtensions.SessionOrigin = FindObjectOfType<SessionOrigin>();
ARCoreExtensions.CameraManager = FindObjectOfType<ARCameraManager>();
// Script is disabled by default since we want to wait for permissions to be granted first, enable it now.
ARCoreExtensions.enabled = true;
}
public void Update()
{
// Do nothing if we haven't enabled ARCoreExtensions yet.
if (!ARCoreExtensions.enabled)
return;
// Do nothing if session isn't ready yet.
if (ARSession.state != ARSessionState.SessionTracking || Input.location.status != LocationServiceStatus.Running)
{
return;
}
// Do nothing if not configured properly.
if (ARCoreExtensions.ARCoreExtensionsConfig.GeospatialMode == GeospatialMode.Disabled)
{
return;
}
if (AREarthManager.IsGeospatialModeSupported(GeospatialMode.Enabled) != FeatureSupported.Supported)
{
// On fresh install the value is always FeatureSupported.Unknown..
return;
}
// Now we can actually work with anchors but I never get here on fresh install because of above check..
this.DoAnchorStuff();
}
}
Also noticed that I have this error when enabling the ARCoreExtensions
(only on fresh install of course), it is probably related?
Failed to create a cross platform ARCore session with error: UnavailableDeviceNotCompatible.
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:LogFormat(LogType, String, Object[])
UnityEngine.Debug:LogErrorFormat(String, Object[])
Google.XR.ARCoreExtensions.Internal.IOSSupportManager:CreateARCoreSession()
Google.XR.ARCoreExtensions.Internal.IOSSupportManager:get_Instance()
Google.XR.ARCoreExtensions.ARCoreExtensions:OnEnable()
UnityEngine.Behaviour:set_enabled(Boolean)
🆙 ! Any help on this issue would be great !
Hi Claudio Did you find a solution for this ? facing the same issue =/ @Tolo789
Having the same issue. Did someone find a solution for this?
This could potentially be caused by a permissions issue, because the GARSession will fail to initialize if it does not have the required permissions (location) for Geospatial, but permissions will be saved for subsequent runs. If you can provide a minimal reproducible sample I can give more detailed feedback