mapbox-unity-sdk
mapbox-unity-sdk copied to clipboard
Non-English Windows User(s) cannot see the Mapbox map system
Note: If this is a bug or support ticket, please provide the following information:
- Unity version:
- Scripting Runtime Version:
- Scripting Backend: Mono
- Api Compatibility Level: .NET Standard 2.0
- Mapbox SDK version: 2.1.1
- The platform you're building to: Win / Mac desktop, 64 bit
- A description of what you're trying to do: see the ground map for German (and other international) users, Win 10
- Steps to recreate the bug if appropriate: Windows 10 international users (German specifically) cannot see the map. I have two confirmed cases both in Germany.
- Links to your logs are also helpful: see below
Here is the player log file for one user.. bold added.
Mono path[0] = 'C:/Program Files (x86)/SkyGlass/SkyGlass_Data/Managed'
Mono config path = 'C:/Program Files (x86)/SkyGlass/MonoBleedingEdge/etc'
Initialize engine version: 2020.3.34f1 (9a4c9c70452b)
[Subsystems] Discovering subsystems at path C:/Program Files (x86)/SkyGlass/SkyGlass_Data/UnitySubsystems
GfxDevice: creating device client; threaded=1
Direct3D:
Version: Direct3D 11.0 [level 11.1]
Renderer: NVIDIA GeForce GTX 1050 Ti (ID=0x1c82)
Vendor:
VRAM: 4018 MB
Driver: 27.21.14.6660
Begin MonoManager ReloadAssembly
- Completed reload, in 0.260 seconds
<RI> Initializing input.
New input system (experimental) initialized
<RI> Input initialized.
<RI> Initialized touch support.
The referenced script on this Behaviour (Game Object 'FavCamButton') is missing!
UnloadTime: 1.054800 ms
DontDestroyOnLoad only works for root GameObjects or components on root GameObjects.
Invalid style - trying to set Custom as default style!
Uploading Crash Report
NullReferenceException: Object reference not set to an instance of an object
at Mapbox.Unity.Map.AbstractMap.UpdateMap (Mapbox.Utils.Vector2d latLon, System.Single zoom) [0x000e3] in <0b74b540b66d44948c748b57a1966a48>:0
at UIController.SetupFlatMap () [0x000a8] in <0b74b540b66d44948c748b57a1966a48>:0
at UIController.SyncUiToCurrentSettings () [0x00012] in <0b74b540b66d44948c748b57a1966a48>:0
at GameController.GameController.Start () [0x00248] in <0b74b540b66d44948c748b57a1966a48>:0
Uploading Crash Report
ArgumentException: Wrong number of arguments
at Mapbox.Unity.Utilities.Conversions.StringToLatLon (System.String s) [0x00062] in <0b74b540b66d44948c748b57a1966a48>:0
at Mapbox.Unity.Map.AbstractMap.InitializeMap (Mapbox.Unity.Map.MapOptions options) [0x00019] in <0b74b540b66d44948c748b57a1966a48>:0
at Mapbox.Unity.Map.AbstractMap.SetUpMap () [0x000af] in <0b74b540b66d44948c748b57a1966a48>:0
at Mapbox.Unity.Map.AbstractMap.MapOnStartRoutine (System.Boolean coroutine) [0x0001e] in <0b74b540b66d44948c748b57a1966a48>:0
at Mapbox.Unity.Map.AbstractMap.Start () [0x00000] in <0b74b540b66d44948c748b57a1966a48>:0
[COMBU 2022-10-01 04:20:45] Connecting to Combu server
[COMBU 2022-10-01 04:20:47] Server version: 3.2.5 (greater: 3.2.2) | Server time: 2022-10-01 14:20 | Client requires upgrade: False
Invalid style - trying to set Custom as default style!
Invalid style - trying to set Custom as default style!
LocationSearchGrid was returned to a pool it wasn't spawned from! Destroying.
Invalid style - trying to set Custom as default style!
Attempting to select while already selecting an object.
Uploading Crash Report
NullReferenceException
at (wrapper managed-to-native) UnityEngine.Behaviour.get_isActiveAndEnabled(UnityEngine.Behaviour)
at UnityEngine.EventSystems.UIBehaviour.IsActive () [0x00000] in <7055a0b6994f4752989c2f481f3faf85>:0
at UnityEngine.UI.Selectable.EvaluateAndTransitionToSelectionState () [0x00000] in <7055a0b6994f4752989c2f481f3faf85>:0
at UnityEngine.UI.Selectable.OnDeselect (UnityEngine.EventSystems.BaseEventData eventData) [0x00007] in <7055a0b6994f4752989c2f481f3faf85>:0
at TMPro.TMP_InputField.OnDeselect (UnityEngine.EventSystems.BaseEventData eventData) [0x00007] in <7b4c50da69e444d598b63409b36e055a>:0
at UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IDeselectHandler handler, UnityEngine.EventSystems.BaseEventData eventData) [0x00000] in <7055a0b6994f4752989c2f481f3faf85>:0
at UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction
1[T1] functor) [0x0006c] in <7055a0b6994f4752989c2f481f3faf85>:0 UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object) UnityEngine.DebugLogHandler:LogException(Exception, Object) UnityEngine.Logger:LogException(Exception, Object) UnityEngine.Debug:LogException(Exception) UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction1) UnityEngine.EventSystems.EventSystem:SetSelectedGameObject(GameObject, BaseEventData) UnityEngine.InputSystem.UI.InputSystemUIInputModule:ProcessPointerButton(ButtonState&, PointerEventData) UnityEngine.InputSystem.UI.InputSystemUIInputModule:ProcessPointer(PointerModel&) UnityEngine.InputSystem.UI.InputSystemUIInputModule:Process() UnityEngine.EventSystems.EventSystem:Update() Uploading Crash Report NullReferenceException: Object reference not set to an instance of an object at PopupHelpManager.ShowPopUpHelp (UnityEngine.Transform helpTarget) [0x0001e] in <0b74b540b66d44948c748b57a1966a48>:0 at UnityEngine.Events.InvokableCall1[T1].Invoke (T1 args0) [0x00010] in <6efa3bca41284615a5ec71875f8706fb>:0 at UnityEngine.Events.CachedInvokableCall1[T].Invoke (System.Object[] args) [0x00001] in <6efa3bca41284615a5ec71875f8706fb>:0 at UnityEngine.Events.UnityEvent1[T0].Invoke (T0 arg0) [0x00086] in <6efa3bca41284615a5ec71875f8706fb>:0 at UnityEngine.EventSystems.EventTrigger.Execute (UnityEngine.EventSystems.EventTriggerType id, UnityEngine.EventSystems.BaseEventData eventData) [0x0003a] in <7055a0b6994f4752989c2f481f3faf85>:0 at UnityEngine.EventSystems.EventTrigger.OnPointerEnter (UnityEngine.EventSystems.PointerEventData eventData) [0x00000] in <7055a0b6994f4752989c2f481f3faf85>:0 at UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IPointerEnterHandler handler, UnityEngine.EventSystems.BaseEventData eventData) [0x00007] in <7055a0b6994f4752989c2f481f3faf85>:0 at UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction1[T1] functor) [0x0006c] in <7055a0b6994f4752989c2f481f3faf85>:0 UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object) UnityEngine.DebugLogHandler:LogException(Exception, Object) UnityEngine.Logger:LogException(Exception, Object) UnityEngine.Debug:LogException(Exception) UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1) UnityEngine.InputSystem.UI.InputSystemUIInputModule:ProcessPointerMovement(ExtendedPointerEventData, GameObject) UnityEngine.InputSystem.UI.InputSystemUIInputModule:ProcessPointerMovement(PointerModel&, ExtendedPointerEventData) UnityEngine.InputSystem.UI.InputSystemUIInputModule:ProcessPointer(PointerModel&) UnityEngine.InputSystem.UI.InputSystemUIInputModule:Process() UnityEngine.EventSystems.EventSystem:Update() Setting up 3 worker threads for Enlighten. Thread -> id: 261c -> priority: 1 Thread -> id: 6d0 -> priority: 1 Thread -> id: 24b0 -> priority: 1 Curl error 42: Callback aborted Curl error 42: Callback aborted
I have now 8 confirmed cases of Non-English versions of Windows failing the Mapbox map system. German (4 users), Brazilian (1), French (1, Canada), Swedish (1), Netherlands (1)
One latest German user's windows details... (not the same as the original crash report), tested on two systems...
System 1: Edition Windows 11 Pro Version 21H2 Installiert am 23.08.2022 Betriebssystembuild 22000.978 Leistung Windows Feature Experience Pack 1000.22000.978.0
System 2: Edition Windows 10 Pro Version 21H2 Installiert am 18.11.2020 Betriebssystembuild 19044.1766 Leistung Windows Feature Experience Pack 120.2212.4180.0
@brnkhy any help on this?
Hey @liquidbuddha! Sorry I just had a chance to look into this.
Looks like an issue with Mapbox.Unity.Utilities.Conversions.StringToLatLon and of course localization of float/double on different devices.
If I remember correct, it's not a very commonly used method and as the logs show, main usage is reading the starting latlng from map object ui/data. so this is probably all about parsing the string you enter via UI OR procedurally.
Now first question is, is it a fixed starting location or are you passing a value to map in runtime? If you are using a value stored somewhere, it's highly likely system stores it with , instead of . for floating point.
Thanks for responding @brnkhy!! Allow me to walk you through the process.. sorry for the extra detail but I figured it would be useful.
On startup, the map loads from a default location... (playerSettings.playerLat = 37.09024; playerSettings.playerLon = -95.712891;) If the player chooses a new home while using the app, that's stored and loaded on startup. The startup process is the same as below, loaded from the playerSettings and passed to Conversions.StringToLatLon after a string conversion.
In my UI, the user can change their "home location" a couple ways.. one is double clicking on the map.. I pass a vector3 ray and use the GetGeoPosition to start things off...
Vector2d geoloc = hitInfo.GetGeoPosition(gameController.goMap.CenterMercator, gameController.goMap.WorldRelativeScale);
That vector2d is stored, I do a reverse Geocode lookup and show that to the user and another button click lets the user home there. The lat/lon is converted from the vector2d and stored as doubles and then passed to the map like this..
string newLatLong = dataController.playerSettings.playerLat.ToString() + "," + dataController.playerSettings.playerLon.ToString();
var vector2D = Conversions.StringToLatLon(newLatLong);
Then I update the map ...
goMap.UpdateMap(vector2D, dataController.playerSettings.mapzoom);
The other way a player can change the home location is from a natural language input field, which is processed by a google geoCode lookup / translation, read from a json web result and converted from a double to a string and stored, then with a button click is processed like above.
So I'm guessing I should do a quick change of "," to "." after I create the newLatLong string before I pass it to the Conversions.StringToLatLon(newLatLong) ? That sound right?
Thanks again.