Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug ArgumentException: The specified path is not of a legal form (empty)

Discussion in 'Editor & General Support' started by gregg_unity270, Jun 2, 2023.

  1. gregg_unity270

    gregg_unity270

    Joined:
    Jan 10, 2023
    Posts:
    3
    I get an error (seen below) whenever I attempt to do a build of the project.

    Has anyone encountered this problem before? If so, how did you get around it?

    Unity Version: 2020.3.48f1
    Burst Version: 1.8.4
    ArgumentException: The specified path is not of a legal form (empty).

    System.IO.Path.InsecureGetFullPath (System.String path) (at <695d1cc93cca45069c528c15c9fdd749>:0) System.IO.Path.GetFullPath (System.String path) (at <695d1cc93cca45069c528c15c9fdd749>:0) Unity.Burst.Editor.BurstLoader.TryResolvePath (System.String path, System.Collections.Generic.Dictionary`2[TKey,TValue] packagesLookup, System.String& resolvedPath) (at Library/PackageCache/com.unity.burst@1.8.4/Runtime/Editor/BurstLoader.cs:554) Unity.Burst.Editor.BurstLoader.GetAssemblyFolders () (at Library/PackageCache/com.unity.burst@1.8.4/Runtime/Editor/BurstLoader.cs:493) Unity.Burst.Editor.BurstLoader..cctor () (at Library/PackageCache/com.unity.burst@1.8.4/Runtime/Editor/BurstLoader.cs:136) Rethrow as TypeInitializationException: The type initializer for 'Unity.Burst.Editor.BurstLoader' threw an exception. Unity.Burst.Editor.BurstAotCompiler.OnPostBuildPlayerScriptDLLsImpl (Unity.Burst.Editor.BurstAotCompiler+BurstAOTSettings settings, UnityEditor.Compilation.Assembly[] playerAssemblies) (at Library/PackageCache/com.unity.burst@1.8.4/Editor/BurstAotCompiler.cs:449) Unity.Burst.Editor.BurstAOTCompilerPostprocessor.DoGenerate (UnityEditor.Compilation.Assembly[] assemblies) (at Library/PackageCache/com.unity.burst@1.8.4/Editor/BurstAotCompiler.cs:265) Unity.Burst.Editor.BurstAOTCompilerPostprocessor.OnPostBuildPlayerScriptDLLs (UnityEditor.Build.Reporting.BuildReport report) (at Library/PackageCache/com.unity.burst@1.8.4/Editor/BurstAotCompiler.cs:189) UnityEditor.Build.BuildPipelineInterfaces.OnPostBuildPlayerScriptDLLs (UnityEditor.Build.Reporting.BuildReport report) (at <25578071f6e44201aac745680e5c8dfc>:0) UnityEditor.BuildPipeline:BuildPlayer(EditorBuildSettingsScene[], String, BuildTarget, BuildOptions)
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,520
    Are you using burst? If so, make sure all the parts of it are up to date and compatible with your version of Unity.

    If you're not using burst, remove it.

    Extra unwanted packages in new projects (collab, testing, rider and other junk):

    https://forum.unity.com/threads/temp-unityengine-testrunner-dll-error.1133938/#post-7287748

    About the fastest way I have found to make a project and avoid all this noise is to create the project, then as soon as you see the files appear, FORCE-STOP (hard-kill) Unity (with the Activity Manager or Task Manager), then go hand-edit the Packages/manifest.json file as outlined in the above post, then reopen Unity.

    Sometimes the package system gets borked from all this unnecessary churn and requires the package cache to be cleared:

    https://stackoverflow.com/questions/53145919/unity3d-package-cache-errors/69779122
     
  3. gregg_unity270

    gregg_unity270

    Joined:
    Jan 10, 2023
    Posts:
    3
    Hi Kurt, thanks for the reply!

    Burst is needed in the project, I've also cleared the package cache and still produces the same error. What's also strange is re-adding Burst, after removing it, in my package manager gives me the same error above (which is ArgumentException: The specified path is not of a legal form (empty). ).

    I'm currently deleting and reinstalling/reimporting everything again and hoping it fixes the problem.
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,520
    Sounds like maybe you're using wiggy-whacky characters in your path.

    If that's the case, don't do that. Use only A to Z and 0 to 9 in directory / file / path names.

    How to troubleshoot build failures:

    First, make a blank project with a single blank scene and prove that it builds successfully.

    If the blank project does NOT build, go fix your Unity installation or your other tools, such as Android SDK, NDK, JDK, etc. It may even be necessary to change to a different version of Unity3D. It is generally best to stay with LTS versions of Unity3D.

    Until you can build a blank project to the target platform, don't fiddle with anything else.

    Once you can build a blank project, now bisect the problem by bringing over parts of your current project and building it one subsystem at a time, perhaps stubbing things out that might trigger compiler errors.

    Most often things that prevent building are third-party libraries such as Firebase.

    Once you identify the subsystem, go to the documentation for it and make sure you are doing it correctly.

    It may also be helpful to work through a tutorial or two for whatever subsystem is making the build fail.

    Android build not building:

    Recently (circa July 2022) there have been reports of Unity's installer failing to install the Android Tools.

    https://forum.unity.com/threads/cant-build-for-android.1306098/

    Here was how I brought up Unity2020.3.41 and the Android SDK 31 on October 30, 2022:

    https://forum.unity.com/threads/aab...y-2021-3-8-with-jdk-1-8.1322211/#post-8551193

    Android Gradle errors and other related stuff:

    https://forum.unity.com/threads/unity-gradle-bug-please-help.1368018/#post-8625789
     
    gregg_unity270 likes this.
  5. gregg_unity270

    gregg_unity270

    Joined:
    Jan 10, 2023
    Posts:
    3
    I can build a blank project fine, though as you said, I did add Burst 1.8.4 and displayed the same error without even building it.

    What seem to worked on the blank project and the current project (and their standalone builds) are Burst 1.6.6 and Burst 1.8.0. Burst 1.8.1 up to 1.8.4 does not work as they give compiler errors.

    So, I think I'll go with Burst 1.8.0 instead.

    Thanks for the help Kurt!