DirectoryNotFoundException: Could not find a part of the path during Linux build on Mac OS X

I’m a newbie just trying out Unity. I made a simple app from a tutorial and successfully built it on the native OS X 10.14.6. Then when I installed the linux build package and tried to build a linux app I get three errors:

DirectoryNotFoundException: Could not find a part of the path '/Applications/Unity/Hub/Editor/2019.4.17f1/PlaybackEngines/LinuxStandaloneSupport/Variations/linux64_withgfx_nondevelopment_mono'.
System.IO.__Error.WinIOError (System.Int32 errorCode, System.String maybeFullPath) (at <9577ac7a62ef43179789031239ba8798>:0)
Build completed with a result of 'Failed' in 12 seconds (11706 ms)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at /Users/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:197)
UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
  at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002af] in /Users/bokken/buildslave/unity/build/Editor/Mono/BuildPlayerWindowBuildMethods.cs:194

Here are the full details of the first exception:

DirectoryNotFoundException: Could not find a part of the path '/Applications/Unity/Hub/Editor/2019.4.17f1/PlaybackEngines/LinuxStandaloneSupport/Variations/linux64_withgfx_nondevelopment_mono'.
System.IO.__Error.WinIOError (System.Int32 errorCode, System.String maybeFullPath) (at <9577ac7a62ef43179789031239ba8798>:0)
System.IO.FileSystemEnumerableIterator`1[TSource].HandleError (System.Int32 hr, System.String path) (at <9577ac7a62ef43179789031239ba8798>:0)
System.IO.FileSystemEnumerableIterator`1[TSource].CommonInit () (at <9577ac7a62ef43179789031239ba8798>:0)
System.IO.FileSystemEnumerableIterator`1[TSource]..ctor (System.String path, System.String originalUserPath, System.String searchPattern, System.IO.SearchOption searchOption, System.IO.SearchResultHandler`1[TSource] resultHandler, System.Boolean checkHost) (at <9577ac7a62ef43179789031239ba8798>:0)
System.IO.FileSystemEnumerableFactory.CreateFileNameIterator (System.String path, System.String originalUserPath, System.String searchPattern, System.Boolean includeFiles, System.Boolean includeDirs, System.IO.SearchOption searchOption, System.Boolean checkHost) (at <9577ac7a62ef43179789031239ba8798>:0)
System.IO.Directory.InternalGetFileDirectoryNames (System.String path, System.String userPathOriginal, System.String searchPattern, System.Boolean includeFiles, System.Boolean includeDirs, System.IO.SearchOption searchOption, System.Boolean checkHost) (at <9577ac7a62ef43179789031239ba8798>:0)
System.IO.Directory.InternalGetFiles (System.String path, System.String searchPattern, System.IO.SearchOption searchOption) (at <9577ac7a62ef43179789031239ba8798>:0)
System.IO.Directory.GetFiles (System.String path) (at <9577ac7a62ef43179789031239ba8798>:0)
UnityEditor.FileUtil.CopyDirectoryFiltered (System.String source, System.String target, System.Boolean overwrite, System.Func`2[T,TResult] includeCallback, System.Boolean recursive) (at /Users/bokken/buildslave/unity/build/Editor/Mono/FileUtil.cs:125)
UnityEditor.LinuxStandalone.LinuxDesktopStandalonePostProcessor.CopyVariationFolderIntoStagingArea (UnityEditor.Modules.BuildPostProcessArgs args, System.Collections.Generic.HashSet`1[T] filesToNotOverwrite) (at /home/bokken/buildslave/unity/build/PlatformDependent/LinuxStandalone/Extensions/Managed/LinuxDesktopStandalonePostProcessor.cs:29)
DesktopStandalonePostProcessor.SetupStagingArea (UnityEditor.Modules.BuildPostProcessArgs args, System.Collections.Generic.HashSet`1[T] filesToNotOverwrite) (at /Users/bokken/buildslave/unity/build/Editor/Mono/BuildPipeline/DesktopStandalonePostProcessor.cs:218)
DesktopStandalonePostProcessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at /Users/bokken/buildslave/unity/build/Editor/Mono/BuildPipeline/DesktopStandalonePostProcessor.cs:42)
Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown.
DesktopStandalonePostProcessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at /Users/bokken/buildslave/unity/build/Editor/Mono/BuildPipeline/DesktopStandalonePostProcessor.cs:60)
UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at /Users/bokken/buildslave/unity/build/Editor/Mono/Modules/DefaultBuildPostprocessor.cs:29)
UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at /Users/bokken/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:340)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at /Users/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:197)

I checked my filing system and the file linux64_withgfx_nondevelopment_mono does not exist. However the following file does:

/Applications/Unity/Hub/Editor/2019.4.17f1/PlaybackEngines/LinuxStandaloneSupport/Variations/linux64_withgfx_nondevelopment_il2cpp/

Might be that only IL2CPP builds are supported on Linux builds, but I don’t know for sure since I don’t target that platform.

At least that’s one place to try first, over in the Player Settings.

1 Like

Thanks. I did choose IL2CPP instead of Mono when I added the package. Presumably, that’s why the linux64_withgfx_nondevelopment_il2cpp file exists and the mono one it is looking for does not. Isn’t the question rather why is it looking for the mono variant and not the il2cpp file? Or how can I tell it to use the il2cpp variant? Is there a build setting somewhere to specify this? From the menu in Build Settings it doesn’t say anything about which Linux build variant is available:

@Kurt-Dekker I think I found what you were referring to in Player Settings → Player. Is this it:

However, now that I have set this to IL2CPP I get a different error!

Now it says ‘Building Linux IL2CPP player requires a sysroot toolchain package to be installed’

Should I just remove this linux build package and replace it with the Mono version instead maybe? I don’t know the differences between the two.

I’m sorry I really don’t know. If I were in your shoes I would google for what I could find, then start trying combinations. It sorta smells like something is wrong with Mono but contextually I have no idea what that even means in Linux land.

You could even be brave and install one of these so-called sysroot toolchain packages… I hear it’s what all the cool kids are using these days. :slight_smile: (tbh, I have no idea wtf that even is)

Solution: I installed the Linux Mono variant and set the scripting backend back to Mono and it works now. Thanks.