Azure / azure-spatial-anchors-samples

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

InvalidOperationException: Could not obtain the ARAnchor.nativePtr #417

Open ryanchenggg opened 8 months ago

ryanchenggg commented 8 months ago

These are the package versions I am currently using, and my Unity Editor version is 2020.3.25f1.

image

Moreover, the packages I used are: MRTK.HoloLens2.Unity.Tutorials.Assets.AzureSpatialAnchors v2.12.0 MRTK.HoloLens2.Unity.Tutorials.Assets.Getting Started v2.7.2

After successfully using the "start azure session" button, I attempted to trigger 'create azure anchor' but consistently encountered the InvalidOperationException: Could not obtain the ARAnchor.nativePtr issue.

Following the tutorial on Learn, I discovered that the error originates from this line in the CreateAzureAnchor method within the AnchorModuleScript: localCloudAnchor.LocalAnchor = await theObject.FindNativeAnchor().GetPointer();

Has anyone else encountered the same problem? How can it be resolved?