Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.IO.FileNotFoundException: Could not locate unity.repl.clj.dll or unity/repl.clj on load path. #44

Closed
JacobGood1 opened this issue Sep 29, 2014 · 19 comments

Comments

@JacobGood1
Copy link

I just tried to place clojure in my assets folder after issue #36 was fixed. I got this error...

System.IO.FileNotFoundException: Could not locate unity.repl.clj.dll or unity/repl.clj on load path.
at clojure.lang.RT.load (System.String relativePath, Boolean failIfNotFound) [0x00000] in :0
at clojure.lang.RT.load (System.String relativePath) [0x00000] in :0
at ClojureRepl.StartREPL () [0x00000] in C:\Users\jacob\Documents\2d Game Practice\Assets\Clojure\Editor\ClojureRepl.cs:30
at ClojureRepl..cctor () [0x00005] in C:\Users\jacob\Documents\2d Game Practice\Assets\Clojure\Editor\ClojureRepl.cs:16
UnityEditor.EditorAssemblies:SetLoadedEditorAssemblies(Assembly[])

@nasser
Copy link
Contributor

nasser commented Sep 29, 2014

What version of Unity are you on? We're on 4.3.0f4.

Some things to try:

  1. Just start the REPL, it might work
  2. Restarting Unity
  3. Close Unity, delete your Library and Temp folders, then open it again

@JacobGood1
Copy link
Author

4.5.4f1 I will try those things, thanks.

@nasser
Copy link
Contributor

nasser commented Sep 29, 2014

Hydration might be a problem for you, then. We're working on it.

@egbulmer
Copy link

Is it a problem with the windows paths? I had to modify ClojureAssetPostprocessor.SetupLoadPath to get rid of that error. The console tells me that the UDP REPL has started, but when I click play it hangs the editor indefinitely. 😓

    static public void SetupLoadPath() {
        string loadPath = "";
        string rootPath = System.Environment.CurrentDirectory.Replace("\\", "/");

        foreach(string path in CompilationRoots) {
            loadPath += rootPath + "/" + path + ";";
        }

        System.Environment.SetEnvironmentVariable("CLOJURE_LOAD_PATH", loadPath);
        Debug.Log(System.Environment.GetEnvironmentVariable("CLOJURE_LOAD_PATH"));
    }

@acron0
Copy link

acron0 commented Sep 30, 2014

The suggested fix from @sonelliot worked for me on 4.3, Windows 7.

@ikarth
Copy link

ikarth commented Sep 30, 2014

I'm on Windows 7, trying the proposed fix. Freezes on play for me in 4.5.3f,
4.3.4f1, an additional error message after starting the REPL, and still freezes on play:

NotSupportedException: The invoked member is not supported in a dynamic module.
System.Reflection.Emit.AssemblyBuilder.get_Location () (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Reflection.Emit/AssemblyBuilder.cs:241)
Unity.PackageManager.PackageManager.RefreshLocalPackagesFromDomain () (at C:/BuildAgent/work/d3d49558e4d408f4/Tools/PackageManager/PackageManager/PackageManager.cs:325)
Unity.PackageManager.PackageManager.StartInstance () (at C:/BuildAgent/work/d3d49558e4d408f4/Tools/PackageManager/PackageManager/PackageManager.cs:133)
Unity.PackageManager.PackageManager.Start () (at C:/BuildAgent/work/d3d49558e4d408f4/Tools/PackageManager/PackageManager/PackageManager.cs:109)
Unity.PackageManager.EntryPoint.Awake () (at C:/BuildAgent/work/d3d49558e4d408f4/Tools/PackageManager/PackageManager/PackageManager.cs:372)
UnityEngine.ScriptableObject:CreateInstance()
Unity.PackageManager.PackageManagerMainThread:.cctor() (at C:/BuildAgent/work/d3d49558e4d408f4/Tools/PackageManager/PackageManager/PackageManager.cs:363)
UnityEditor.EditorAssemblies:SetLoadedEditorAssemblies(Assembly[])

@depy
Copy link

depy commented Sep 30, 2014

Having the same issue. Freezes and trying to start REPL gives me the same error: "Could not locate unity.repl.clj.dll or unity/repl.clj on load path"

@nasser
Copy link
Contributor

nasser commented Sep 30, 2014

@ikarth Strange. That stacktrace doesn't hit any of our code. Does it work without the Clojure folder in it?
@depy Are you on Windows, too?

@ikarth
Copy link

ikarth commented Sep 30, 2014

@nasser Remove Clojure folder, press play: it works (and does nothing much because it's an otherwise empty project). Put Clojure folder back: Debug.Log the path, Starting UDP REPL..., NotSupportedException. I assume it has something to do with something that is being dynamically created at runtime. Does seem odd.

The error message does not appear in 4.5; though pressing play still seems to freeze the Unity editor.

@nasser
Copy link
Contributor

nasser commented Sep 30, 2014

@ikarth is Edit > Project Settings > Api Compatibility Level at .NET 2.0?

@ikarth
Copy link

ikarth commented Sep 30, 2014

@nasser Yes, unfortunately. First thing I checked. I think I'll try it on another machine here and see if its somehow specific to this one.

@ikarth
Copy link

ikarth commented Oct 1, 2014

@nasser Clean install, Windows 7, Unity 4.3.4. Add Clojure folder: System.IO.FileNotFoundException: Could not locate unity.repl.clj.dll or unity/repl.clj on load path and NotSupportedException: The invoked member is not supported in a dynamic module. Pressing play works but REPL does not run (probably because it can't find repl.clj).

Making the proposed change to SetupLoadPath() lets Unity find the REPL and start it. Another NotSupportedException appears, but the REPL seems to be working (haven't tried connecting to it yet). Pressing play at that point causes the editor to hang. Not sure if it ever recovers from the hang, I'm going to leave it running to check, though the NotSupportedException makes me think there's still an issue.

@depy
Copy link

depy commented Oct 1, 2014

@nasser yes, windows 7.

@ikarth
Copy link

ikarth commented Oct 6, 2014

@nasser Same machine, Windows 7: parade-route works, clojure-unity doesn't. (Freezes when you hit the play button.)

@ikarth
Copy link

ikarth commented Oct 7, 2014

For future reference, I have the REPL working, though 'play' still freezes. If anyone else is having issues, connect to the REPL (the client Ruby script in the Extras folder is probably simplest for testing) and try a simple command like (GameObject. "Hello World").

EDIT: Play works...some of the time. I haven't worked out what the difference is, though it may just be a delay. I moved the DLLs to the Compiled folder, that seemed to help, though I haven't tested extensively.

Code for Windows paths with no errors on Unity 4.5.3 (that may break everything else, so use at your own risk, I haven't tested much):

 static public string[] CompilationRoots = new [] {
        "Assets\\Clojure\\Scripts",
        "Assets\\Clojure\\Libraries",
        "Assets\\Clojure\\Internal",
    };

    static public string pathToAssemblies = "Assets\\Clojure\\Compiled";

    static public void SetupLoadPath() {
        string loadPath = Path.Combine(System.Environment.CurrentDirectory, pathToAssemblies);
        foreach(string path in CompilationRoots) {
            loadPath += ";" + Path.Combine(System.Environment.CurrentDirectory, path);
        }

        System.Environment.SetEnvironmentVariable("CLOJURE_LOAD_PATH", loadPath);
        Debug.Log(System.Environment.GetEnvironmentVariable("CLOJURE_LOAD_PATH"));
    }

@ikarth
Copy link

ikarth commented Feb 27, 2015

A status update:

As of today, on Windows 7, Arcadia-master and Unity 4.6.0f3 produces the following error message on initialization:

System.IO.FileNotFoundException: Could not locate arcadia.repl.clj.dll or arcadia/repl.clj on load path.
  at clojure.lang.RT.load (System.String relativePath, Boolean failIfNotFound) [0x00000] in <filename unknown>:0 
  at clojure.lang.RT.load (System.String relativePath) [0x00000] in <filename unknown>:0 
  at ClojureRepl.StartREPL () [0x00000] in F:\Isaac\Projects\2015\Unity\ArcadiaPlayground\Assets\Arcadia\Editor\ClojureRepl.cs:30 
  at ClojureRepl..cctor () [0x00005] in F:\Isaac\Projects\2015\Unity\ArcadiaPlayground\Assets\Arcadia\Editor\ClojureRepl.cs:16 
UnityEditor.EditorAssemblies:SetLoadedEditorAssemblies(Assembly[])

Arcadia-develop and Unity 4.6.0f3 produces the following:

Starting Arcadia...
UnityEngine.Debug:Log(Object)
Arcadia.Initialization:Initialize() (at Assets/Arcadia/Editor/Initialization.cs:17)
Arcadia.Initialization:.cctor() (at Assets/Arcadia/Editor/Initialization.cs:12)
UnityEditor.EditorAssemblies:SetLoadedEditorAssemblies(Assembly[])
---
Checking Unity Settings...
UnityEngine.Debug:Log(Object)
Arcadia.Initialization:CheckSettings() (at Assets/Arcadia/Editor/Initialization.cs:27)
Arcadia.Initialization:Initialize() (at Assets/Arcadia/Editor/Initialization.cs:19)
Arcadia.Initialization:.cctor() (at Assets/Arcadia/Editor/Initialization.cs:12)
UnityEditor.EditorAssemblies:SetLoadedEditorAssemblies(Assembly[])
---
Setting Load Path...
UnityEngine.Debug:Log(Object)
Arcadia.Initialization:SetClojureLoadPath() (at Assets/Arcadia/Editor/Initialization.cs:41)
Arcadia.Initialization:Initialize() (at Assets/Arcadia/Editor/Initialization.cs:20)
Arcadia.Initialization:.cctor() (at Assets/Arcadia/Editor/Initialization.cs:12)
UnityEditor.EditorAssemblies:SetLoadedEditorAssemblies(Assembly[])
---
Load Path is F:\Isaac\Projects\2015\Unity\ArcadiaPlayground\Assets\Arcadia\Compiled:F:\Isaac\Projects\2015\Unity\ArcadiaPlayground\Assets\Arcadia\Source:F:\Isaac\Projects\2015\Unity\ArcadiaPlayground\Assets
UnityEngine.Debug:Log(Object)
Arcadia.Initialization:SetClojureLoadPath() (at Assets/Arcadia/Editor/Initialization.cs:51)
Arcadia.Initialization:Initialize() (at Assets/Arcadia/Editor/Initialization.cs:20)
Arcadia.Initialization:.cctor() (at Assets/Arcadia/Editor/Initialization.cs:12)
UnityEditor.EditorAssemblies:SetLoadedEditorAssemblies(Assembly[])
---
System.TypeInitializationException: An exception was thrown by the type initializer for ClojureRepl ---> System.TypeInitializationException: An exception was thrown by the type initializer for clojure.lang.RT ---> System.IO.FileNotFoundException: Could not locate clojure.core.clj.dll or clojure/core.clj on load path.
  at clojure.lang.RT.load (System.String relativePath, Boolean failIfNotFound) [0x00000] in <filename unknown>:0 
  at clojure.lang.RT.load (System.String relativePath) [0x00000] in <filename unknown>:0 
  at clojure.lang.RT.DoInit () [0x00000] in <filename unknown>:0 
  at clojure.lang.RT..cctor () [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at ClojureRepl..cctor () [0x00000] in F:\Isaac\Projects\2015\Unity\ArcadiaPlayground\Assets\Arcadia\Editor\ClojureRepl.cs:15 
  --- End of inner exception stack trace ---
  at Arcadia.Initialization.StartREPL () [0x00005] in F:\Isaac\Projects\2015\Unity\ArcadiaPlayground\Assets\Arcadia\Editor\Initialization.cs:59 
  at Arcadia.Initialization.Initialize () [0x00014] in F:\Isaac\Projects\2015\Unity\ArcadiaPlayground\Assets\Arcadia\Editor\Initialization.cs:21 
  at Arcadia.Initialization..cctor () [0x00000] in F:\Isaac\Projects\2015\Unity\ArcadiaPlayground\Assets\Arcadia\Editor\Initialization.cs:12 
UnityEditor.EditorAssemblies:SetLoadedEditorAssemblies(Assembly[])
---
FileNotFoundException: Could not locate clojure.core.clj.dll or clojure/core.clj on load path.
clojure.lang.RT.load (System.String relativePath, Boolean failIfNotFound)
clojure.lang.RT.load (System.String relativePath)
clojure.lang.RT.DoInit ()
clojure.lang.RT..cctor ()
Rethrow as TypeInitializationException: An exception was thrown by the type initializer for clojure.lang.RT
ClojureRepl..cctor () (at Assets/Arcadia/Editor/ClojureRepl.cs:15)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.AssetPostprocessingInternal.PostprocessAllAssets (System.String[] importedAssets, System.String[] addedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromPathAssets) (at C:/BuildAgent/work/d63dfc6385190b60/Editor/Mono/AssetPostprocessor.cs:26)

The AOT compilation doesn't seem to be working, the Compiled directory is empty.

@gfixler
Copy link

gfixler commented Jun 26, 2015

New user here. I also have this error on startup, Win 7 64, Ruby 2.1.6, Unity 4.6.0b20:

FileNotFoundException: Could not locate .clj.dll or .clj on load path.
clojure.lang.RT.load (System.String relativePath, Boolean failIfNotFound)
clojure.lang.RT.load (System.String relativePath)
clojure/core$load$fn__5855__5859.invoke ()
clojure/core$load__5862.doInvoke (System.Object )
clojure.lang.RestFn.invoke (System.Object arg1)
clojure/core$load_one__5735.invoke (System.Object , System.Object , System.Object )
clojure/core$compile$fn__5869__5873.invoke ()
clojure/core$compile__5876.invoke (System.Object )
clojure.lang.Var.invoke (System.Object arg1)
ClojureAssetPostprocessor.OnPostprocessAllAssets (System.String[] importedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromAssetPaths) (at Assets/Arcadia/Editor/ClojureAssetPostprocessor.cs:74)
UnityEngine.Debug:LogException(Exception)
ClojureAssetPostprocessor:OnPostprocessAllAssets(String[], String[], String[], String[]) (at Assets/Arcadia/Editor/ClojureAssetPostprocessor.cs:79)
UnityEditor.AssetPostprocessingInternal:PostprocessAllAssets(String[], String[], String[], String[], String[])

I also managed to get the REPL up and working with the change from @sonelliot. Any work toward fixing the .clj.dll/.clj locate bug over the last few months?

@nasser nasser closed this as completed Apr 1, 2016
@hatmatter
Copy link

hatmatter commented May 22, 2016

@nasser Was there a comment related to closing this issue? Did I miss the resolution? I am seeing this issue with the most recent release.

edit. oh I see, this issue was relpaced with #104 correct?

@nasser
Copy link
Contributor

nasser commented May 22, 2016

Yup, closed as a dup. Should have been more clear of that!

@hatmatter you should jump on the gitter if you're still seeing this issue. I'd be happy to walk you though it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants