# WayspotAnchorService LocalizationState always return Failed

**URL:** <https://community.nianticspatial.com/t/wayspotanchorservice-localizationstate-always-return-failed/3667>\
**Category:** I'm Stuck\
**Tags:** guidance\
**Created:** [June 29, 2023, 3:28pm UTC](https://community.nianticspatial.com/t/wayspotanchorservice-localizationstate-always-return-failed/3667 "2023-06-29T15:28:09Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alefe\_Bispo\_Silva](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@Alefe\_Bispo\_Silva](https://community.nianticspatial.com/u/Alefe_Bispo_Silva)\
**Post date:** [June 29, 2023, 3:28pm UTC](https://community.nianticspatial.com/t/wayspotanchorservice-localizationstate-always-return-failed/3667/1 "2023-06-29T15:28:09Z")

</div>

- **Device type & OS version** : Android
- **Host machine & OS version** : Windows
- **Issue Environment** : On Device
- **Xcode version** :
- **ARDK version** :
- \*\*Unity version_2020.3.19f1_:

Description of the issue: When executing the app via Unity and Vitual Studio, the LocatizationState always return Localized, but when i execute the app apk on device the LocalizationState always return Failed. Screenshot of the AndroidManifest:

 ![manifest](https://us1.discourse-cdn.com/niantic/original/2X/1/1fe382cdfd3867aae9b2dd267fae44d6f355d357.png)

EDIT: The FailureReason of the method LocalizationStatusUpdated returned NotSupportedAtLocation on a device and Timeout on another device.

---

<div class="post-metadata">

**Author:** ![Jesus\_Niantic](https://avatars.discourse-cdn.com/v4/letter/j/b782af/32.png) [@Jesus\_Niantic](https://community.nianticspatial.com/u/Jesus_Niantic)\
**Post date:** [June 29, 2023, 8:29pm UTC](https://community.nianticspatial.com/t/wayspotanchorservice-localizationstate-always-return-failed/3667/2 "2023-06-29T20:29:58Z")

</div>

Hello Alefe,

Since you’re able to build your project, the Manifest shouldn’t be an issue. Can you share the code you’ve written to set up and run VPS?

---

<div class="post-metadata">

**Author:** ![Alefe\_Bispo\_Silva](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@Alefe\_Bispo\_Silva](https://community.nianticspatial.com/u/Alefe_Bispo_Silva)\
**Post date:** [June 30, 2023, 12:35pm UTC](https://community.nianticspatial.com/t/wayspotanchorservice-localizationstate-always-return-failed/3667/3 "2023-06-30T12:35:03Z")

</div>

I think these are the most important functions i’m using:

```auto
 private void OnEnable()
    {
        ARSessionFactory.SessionInitialized += HandleSessionInitialized;
    }

```

```auto
   private void OnDisable()
    {
        ARSessionFactory.SessionInitialized -= HandleSessionInitialized;
    }

```

```auto
 private void HandleSessionInitialized(AnyARSessionInitializedArgs anyARSessionInitializedArgs)
    {
        _statusLog.text = "Running Session...";
        _arSession = anyARSessionInitializedArgs.Session;
        _arSession.Ran += HandleSessionRan;
    }

```

```auto
   private void HandleSessionRan(ARSessionRanArgs arSessionRanArgs)
    {
        _arSession.Ran -= HandleSessionRan;
        _wayspotAnchorService = CreateWayspotAnchorService();
        _statusLog.text = "Session Initialized.";
    }

```

```auto
 private WayspotAnchorService CreateWayspotAnchorService()
    {
        var wayspotAnchorsConfiguration = WayspotAnchorsConfigurationFactory.Create();
      
        var locationService = LocationServiceFactory.Create(_arSession.RuntimeEnvironment);
        locationService.Start();

        //When continuous localization is enabled, VPS will continue to localize to the user’s current surroundings after the initial localization.
        wayspotAnchorsConfiguration.ContinuousLocalizationEnabled = true;

        var wayspotAnchorService = new WayspotAnchorService(_arSession, locationService, wayspotAnchorsConfiguration);

        wayspotAnchorService.LocalizationStateUpdated += LocalizationStateUpdated;

        return wayspotAnchorService;
    }

```

---

<div class="post-metadata">

**Author:** ![Alefe\_Bispo\_Silva](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@Alefe\_Bispo\_Silva](https://community.nianticspatial.com/u/Alefe_Bispo_Silva)\
**Post date:** [June 30, 2023, 1:16pm UTC](https://community.nianticspatial.com/t/wayspotanchorservice-localizationstate-always-return-failed/3667/4 "2023-06-30T13:16:10Z")

</div>

I have a question: for the location state to have the status of localized, do I need to have a scanned test vps active in my project’s geospatial browser? At least when running on a device, because inside the unity editor the status always return localized.

---

<div class="post-metadata">

**Author:** ![Jesus\_Niantic](https://avatars.discourse-cdn.com/v4/letter/j/b782af/32.png) [@Jesus\_Niantic](https://community.nianticspatial.com/u/Jesus_Niantic)\
**Post date:** [June 30, 2023, 11:31pm UTC](https://community.nianticspatial.com/t/wayspotanchorservice-localizationstate-always-return-failed/3667/5 "2023-06-30T23:31:39Z")

</div>

Hello Alefe,

I see that your code is fairly similar to the sample we have on our documentation. Are you following any other examples? The code looks correct as far as I can tell. I also noticed that you’re using OnDisable and OnEnable. Just want to double check that you’re aware that you’re taking full manual control over the manager. If you have the manager attached as a component to something in the hierarchy, make sure that the “Manage Using Unity Lifecycle” box is unchecked.

---

<div class="post-metadata">

**Author:** ![Alefe\_Bispo\_Silva](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@Alefe\_Bispo\_Silva](https://community.nianticspatial.com/u/Alefe_Bispo_Silva)\
**Post date:** [July 3, 2023, 3:05am UTC](https://community.nianticspatial.com/t/wayspotanchorservice-localizationstate-always-return-failed/3667/6 "2023-07-03T03:05:32Z")

</div>

Where exactly can i check the “Manage Using Unity Lifecycle” option? Here is a screenshot of my manager:

 ![SceneManager](https://us1.discourse-cdn.com/niantic/original/2X/1/108f0857cbba4e72b81e2be9f34d6bab495ade10.png)  
EDIT: found the “Manage Using Unity Lifecycle” on the Capability Checker script

---

<div class="post-metadata">

**Author:** ![Alefe\_Bispo\_Silva](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@Alefe\_Bispo\_Silva](https://community.nianticspatial.com/u/Alefe_Bispo_Silva)\
**Post date:** [July 3, 2023, 3:08am UTC](https://community.nianticspatial.com/t/wayspotanchorservice-localizationstate-always-return-failed/3667/7 "2023-07-03T03:08:12Z")

</div>

So what other options could be causing this issue? Could it be that when i test on a mobile device the vps location cant be localized? I only tested on private vps locations

---

<div class="post-metadata">

**Author:** ![Jesus\_Niantic](https://avatars.discourse-cdn.com/v4/letter/j/b782af/32.png) [@Jesus\_Niantic](https://community.nianticspatial.com/u/Jesus_Niantic)\
**Post date:** [July 4, 2023, 2:00am UTC](https://community.nianticspatial.com/t/wayspotanchorservice-localizationstate-always-return-failed/3667/8 "2023-07-04T02:00:37Z")

</div>

Hey Alefe,

That’s a screenshot of the Session Manager I would need a screenshot of the VPS Manager. If possible can I also know what guides you’re following to get an idea of how you’re setting up VPS

---

<div class="post-metadata">

**Author:** ![Maverick\_Niantic](https://avatars.discourse-cdn.com/v4/letter/m/8edcca/32.png) [@Maverick\_Niantic](https://community.nianticspatial.com/u/Maverick_Niantic)\
**Post date:** [March 5, 2026, 11:19pm UTC](https://community.nianticspatial.com/t/wayspotanchorservice-localizationstate-always-return-failed/3667/9 "2026-03-05T23:19:19Z")

</div>


