Skip to content

Some users reported "Mapbox token not valid" error (windows built). #2

@huiwuinity

Description

@huiwuinity

Some users reported "Mapbox token not valid" error in running WUI-NITY.

This error is triggered in the following function in AbstractMap.cs:
public bool IsAccessTokenValid
which throws System. Exception when running to
var accessTokenCheck = Unity.MapboxAccess.Instance;
and then the Mapbox access token is flagged as invalid. It has been verified that the token can be correctly loaded from resources (Resources.Load).

The problem is down to the following function in MapboxAccess.cs when creating a new instance of MapboxAccess.
void ConfigureFileSource() { _fileSource = new CachingWebFileSource(_configuration.AccessToken, _configuration.GetMapsSkuToken, _configuration.AutoRefreshCache) .AddCache(new MemoryCache(_configuration.MemoryCacheSize)) #if !UNITY_WEBGL .AddCache(new SQLiteCache(_configuration.FileCacheSize)) #endif ; }

Comment out the following code temporarily solves the problem.
.AddCache(new MemoryCache(_configuration.MemoryCacheSize)) .AddCache(new SQLiteCache(_configuration.FileCacheSize))

Need to look into this as for why it affects some users, but not all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions