-1

I am trying to learn how to use the AzureSpatialAnchor properly with unity using Hololens 2 and an android cellphone.

I downloaded the Unity GitHub example, and I modified the Start() of the AzureSpatialAnchorBasicDemoScript.cs as follow in order to skip all the previous steps for creating an anchor and to directly search for an anchor I previously created (The anchor creation is also shown in the Azure Portal, and it was created with a similar script with an expiration date set to 7 days)

public override void Start()
        {
            Debug.Log(">>Azure Spatial Anchors Demo Script Start");

            base.Start();

            if (!SanityCheckAccessConfiguration())
            {
                return;
            }
            feedbackBox.text = stateParams[currentAppState].StepMessage;

            Debug.Log("Azure Spatial Anchors Demo script started");
\\PART ADDED
#if UNITY_DEBUG
            currentAppState = AppState.DemoStepCreateSessionForQuery;
            currentAnchorId = "1460f7f6-b3ef-4afc-b425-4ec94cd953f7";
#endif
}

When I build the app with the "AzureSpatialAnchorsBasicDemo" and "AzureSpatialAnchorsDemoLauncher", it never stops looking for the anchor or it shows me a message telling "Possible anchor locate {anchorId} status: NotLocatedAnchorDoesNotExist".

Azure Spatial Anchor documentation tells for this problem "The anchor was deleted or never existed in the first place" but no delete operation is present in the Azure Portal after the creation of the anchor.

How can I debug this problem? What could be the possible issues?

  • You can refer to [Can't retrieve Azure Spatial Anchor (unity3D, Hololens 2)](https://learn.microsoft.com/en-us/answers/questions/528761/can39t-retrieve-azure-spatial-anchor-unity3d-holol.html) and [Unable to find Azure Spatial Anchor on another HoloLens 2](https://github.com/Azure/azure-spatial-anchors-samples/issues/291) – Ecstasy Sep 06 '21 at 07:42

1 Answers1

0

I have two scene in my game: one for hololens and one for android, both of them were retrieving the ASA credential from a server that were overwriting the one specified in the inspector on purpose.

The problem was that one of them was not doing that: thus I was using two different credential for android and hololens.