Play nice with multi-platform development (errors with GDK package on macOS)
sttz opened this issue · 1 comments
sttz commented
When importing the package on macOS, I'm getting following errors when it tries to access the registry through Window-specific APIs.
I'm aware GDK is not supported on macOS but our projects targets multiple platforms and needs to run on macOS. The GDK package should check if it's not running in the Windows Unity editor and disable everything that relies on Windows-specific APIs and functionality.
Errors in macOS Unity editor
Failed to get key: Advapi32.dll assembly:<unknown assembly> type:<unknown type> member:(null)
UnityEngine.Debug:LogError (object)
Microsoft.GameCore.Utilities.GdkUtilities/RegUtil:GetRegKey (uint,string,string) (at Assets/GDK-Tools/Source/Utilities/GdkUtilities.cs:236)
Microsoft.GameCore.Utilities.GdkUtilities:get_GdkVersion () (at Assets/GDK-Tools/Source/Utilities/GdkUtilities.cs:37)
Microsoft.GameCore.Utilities.GdkUtilities:PullGdkDlls () (at Assets/GDK-Tools/Source/Utilities/GdkUtilities.cs:152)
Microsoft.GameCore.Tools.GdkPlugin:.cctor () (at Assets/GDK-Tools/Source/Editor/GdkPlugin.cs:20)
UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes (System.Type[]) (at /Users/bokken/build/output/unity/unity/Editor/Mono/EditorAssemblies.cs:126)
System.ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length
at System.String.Substring (System.Int32 startIndex, System.Int32 length) [0x0004c] in <b476499a37ba4db68de311f404f49770>:0
at Microsoft.GameCore.Utilities.GdkUtilities.PullGdkDlls () [0x0002f] in Assets/GDK-Tools/Source/Utilities/GdkUtilities.cs:157
at Microsoft.GameCore.Tools.GdkPlugin..cctor () [0x00000] in Assets/GDK-Tools/Source/Editor/GdkPlugin.cs:20
UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes (System.Type[]) (at /Users/bokken/build/output/unity/unity/Editor/Mono/EditorAssemblies.cs:134)
No MicrosoftGame.Config found. Please re-import this plugin.
UnityEngine.Debug:LogError (object)
Microsoft.GameCore.Utilities.GdkUtilities:get_GameConfigPath () (at Assets/GDK-Tools/Source/Utilities/GdkUtilities.cs:131)
Microsoft.Xbox.Gdk:OnValidate () (at Assets/GDK-Tools/Source/Scripts/Gdk.cs:149)
edwarduwms commented
Thank you, we will take your feedback into consideration for the next releases.