-
Notifications
You must be signed in to change notification settings - Fork 4
Description
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.