Strange issues when attempting to build on Linux with IL2CPP

I am using 2019.3.0b9

The target platform for my project is Linux, but I usually build from a Windows machine. On Windows, only the Mono scripting backend is available for Linux. I wanted to try a build with IL2CPP, so I moved my project over to a machine running Ubuntu and tried to build it in the Linux Editor.

The first error I ran into was the build failing and an error message complaining about not being able to run il2cpp.exe because there was no file located at usr/bin/clang (I don’t have the exact text of the error because it seemed to be resolved by the following). I installed Clang, and this seemed to resolve the issue.

After this, builds now complete successfully. However, whereas on Windows successful completion of a build opens the folder where that build is located, when a build finishes on Linux it opens the audio player “Audacious” with an error “No files found”. There is still a “Build completed with a result of ‘Succeeded’” message in the Editor console.

When I go to run the executable that has been generated, I get a lot of flashing garbage accompanied by some of the assets in my game in incorrect positions.

I see several errors like the following in the Player log:

NullReferenceException: Object reference not set to an instance of an object.
  at System.Linq.Expressions.Interpreter.LightLambda.MakeRunDelegateCtor (System.Type delegateType) [0x00000] in <00000000000000000000000000000000>:0
  at System.Linq.Expressions.Interpreter.LightLambda.GetRunDelegateCtor (System.Type delegateType) [0x00000] in <00000000000000000000000000000000>:0
  at System.Linq.Expressions.Interpreter.LightDelegateCreator.CreateDelegate (System.Runtime.CompilerServices.IStrongBox[] closure) [0x00000] in <00000000000000000000000000000000>:0
  at Newtonsoft.Json.Utilities.ExpressionReflectionDelegateFactory.CreateParameterizedConstructor (System.Reflection.MethodBase method) [0x00000] in <00000000000000000000000000000000>:0
  at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateObjectContract (System.Type objectType) [0x00000] in <00000000000000000000000000000000>:0
  at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateContract (System.Type objectType) [0x00000] in <00000000000000000000000000000000>:0
  at System.Func`2[T,TResult].Invoke (T arg) [0x00000] in <00000000000000000000000000000000>:0
  at System.Collections.Concurrent.ConcurrentDictionary`2[TKey,TValue].GetOrAdd (TKey key, System.Func`2[T,TResult] valueFactory) [0x00000] in <00000000000000000000000000000000>:0
  at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType, System.Boolean checkAdditionalContent) [0x00000] in <00000000000000000000000000000000>:0
  at Newtonsoft.Json.JsonSerializer.DeserializeInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x00000] in <00000000000000000000000000000000>:0
  at Newtonsoft.Json.JsonConvert.DeserializeObject (System.String value, System.Type type, Newtonsoft.Json.JsonSerializerSettings settings) [0x00000] in <00000000000000000000000000000000>:0
  at Newtonsoft.Json.JsonConvert.DeserializeObject[T] (System.String value, Newtonsoft.Json.JsonSerializerSettings settings) [0x00000] in <00000000000000000000000000000000>:0
  at UnityEngine.GameObject.AddComponent[T] () [0x00000] in <00000000000000000000000000000000>:0
UnityEngine.GameObject:AddComponent()

What can I do to get a working executable from building on Ubuntu with IL2CPP?

Found the following when searching for the NullReferenceException I was getting:

Adding the link.xml file to my Assets folder solved the problem, and my game now boots properly. Still odd about files attempting to open in Audacious, but I hope this can help someone else!

Does your game work properly? Did you not encounter this IL2CPP issue when building for Windows?

My game is working properly now. As my target platform is Linux and I am developing primarily on Windows, I had only ever been making builds with a Mono backend. I have not tried a Windows build with IL2CPP but I would imagine I would have seen the same error, since it turned out to be with IL2CPP and the json library, not specifically Linux or the Linux Editor.

Ok, cool.

As for Audacious opening: we use “xdg-open <build_folder>” to open the build’s folder in your default file browser. It’s likely Audacious has registered itself as the default folder handler on your machine. See this: Audacious run when I press Open with or Show in Folder in XFCE in Arch for any kind of file - Unix & Linux Stack Exchange

Thanks for the link. I got some odd behavior while fixing it, but ultimately I was able to do it. Here’s what I did for posterity:

  1. I checked my default file browser with “xdg-mime query default inode/directory”. It was properly set to “pcmanfm.desktop”
  2. I went into “audacious.desktop” and saw that “inode/directory” was set as one of its defaults. I deleted this, saved, rebuilt my game in Unity, and Audacious still opened.
  3. I explicitly set pcmanfm as the default file browser with “xdg-mime default pcmanfm.desktop inode/directory” even though it was already set as the default. When I did this and then rebuilt in Unity, the build folder now properly opens in PCManFM.

Hope this can help someone!

Hi since this thread is relatively new - just had a question. The bug report page says:

Is this something thats on the horizon? There isn’t really anywhere to keep ‘track’ of the state of this, so we wont really know when it is ‘done’ until one day it is.

1 Like