[2.0] IL2CPP issue on Windows x64

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
mgregoirelds
Posts: 106
Joined: Wed Aug 23, 2017 4:10 pm
Location: Canada

[2.0] IL2CPP issue on Windows x64

Post by mgregoirelds »

Hello,

I'm trying to build my game using IL2CPP scripting backend on Windows x64 using 2.0.0 and I am getting the following error:

Code: Select all

stdout:
Fatal error in Unity CIL Linker
Mono.Linker.Steps.XmlResolutionException: Unable to find the file for the assembly named 'Assembly-CSharp-firstpass, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' specified in link file 'D:\Sardonyx\Sources\Sardonyx\Assets\Externals\Pixel Crushers\Dialogue System\Templates\Link\link.xml'. Should this assembly be in the project? Use the 'ignoreIfMissing="1"' attribute if this assembly may not always exist. ---> Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'Assembly-CSharp-firstpass, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' ---> Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'Assembly-CSharp-firstpass, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
   at Unity.Linker.LocalDirectoryAssemblyResolver.Resolve(AssemblyNameReference name, ReaderParameters parameters)
   at Unity.Linker.UnityAssemblyResolver.Resolve(AssemblyNameReference name, ReaderParameters parameters)
   at Mono.Linker.LinkContext.Resolve(IMetadataScope scope)
   --- End of inner exception stack trace ---
   at Mono.Linker.LinkContext.Resolve(IMetadataScope scope)
   at Mono.Linker.Steps.ResolveFromXmlStep.GetAssembly(LinkContext context, AssemblyNameReference assemblyName)
   at Unity.Linker.Steps.UnityResolveFromXmlStep.ProcessAssemblies(LinkContext context, XPathNodeIterator iterator)
   --- End of inner exception stack trace ---
   at Unity.Linker.Steps.UnityResolveFromXmlStep.ProcessAssemblies(LinkContext context, XPathNodeIterator iterator)
   at Mono.Linker.Steps.ResolveFromXmlStep.Process()
   at Mono.Linker.Steps.BaseStep.Process(LinkContext context)
   at Mono.Linker.Pipeline.Process(LinkContext context)
   at Unity.Linker.UnityDriver.Run()
   at Unity.Linker.UnityDriver.RunDriver()
stderr:

UnityEngine.Debug:LogError(Object)
UnityEditorInternal.Runner:RunProgram(Program, String, String, String, CompilerOutputParserBase) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:128)
UnityEditorInternal.Runner:RunManagedProgram(String, String, String, CompilerOutputParserBase, Action`1) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:73)
UnityEditorInternal.AssemblyStripper:RunAssemblyLinker(IEnumerable`1, String&, String&, String, String) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:89)
UnityEditorInternal.AssemblyStripper:StripAssembliesTo(String[], String[], String, String, String&, String&, String, IIl2CppPlatformProvider, IEnumerable`1) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:82)
UnityEditorInternal.AssemblyStripper:RunAssemblyStripper(IEnumerable, String, String[], String[], String, IIl2CppPlatformProvider, RuntimeClassRegistry) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:203)
UnityEditorInternal.AssemblyStripper:StripAssemblies(String, IIl2CppPlatformProvider, RuntimeClassRegistry) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:113)
UnityEditorInternal.IL2CPPBuilder:Run() (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:154)
UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, IIl2CppPlatformProvider, Action`1, RuntimeClassRegistry) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:42)
DesktopStandalonePostProcessor:SetupStagingArea(BuildPostProcessArgs) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/DesktopStandalonePostProcessor.cs:192)
DesktopStandalonePostProcessor:PostProcess(B
Any idea why I am getting this issue? Is it really related to Dialogue System? I was able to properly build a il2cpp build when using 1.8.2, so my guess is that it is a new 2.x problem.

Thanks!
Unity 2022.3.17f1
Dialogue System 2.2.44.1
OpenAI Addon 1.0.12
User avatar
Tony Li
Posts: 22058
Joined: Thu Jul 18, 2013 1:27 pm

Re: [2.0] IL2CPP issue on Windows x64

Post by Tony Li »

Hi,

Have you tried the patch on the Pixel Crushers customer download site? (I'll PM you your access info right after this.)

Please also check the file Assets / Plugins / Pixel Crushers / Dialogue System / Templates / Link / link.xml. Does it match this?

Code: Select all

<linker>
    <assembly fullname="Assembly-CSharp-firstpass">
        <namespace fullname="PixelCrushers.DialogueSystem.SequencerCommands" preserve="all"/>
    </assembly>
</linker>
I just tested an IL2CPP build with these settings:
  • Unity 2018.1.2f1
  • Target Platform: Windows
  • Architecture: x86_64
  • Scripting Runtime Version: .NET 4x Equivalent
  • Scripting Backend: IL2CPP
  • API Compatibility Level: .NET 4.x
mgregoirelds
Posts: 106
Joined: Wed Aug 23, 2017 4:10 pm
Location: Canada

Re: [2.0] IL2CPP issue on Windows x64

Post by mgregoirelds »

Hello Tony,

I just tested with the latest patch and I'm still having the same issue. Could it be that the main path for Dialogue System is not directly in the root as default when I'm installing the package? My install is in "Externals\Pixel Crushers\..." instead.

I'll put that issue on hold anyway as I need to do a build for Comiccon in two weeks, I'll use a Mono build for now, but I'll test out later with a demo scene to see if I'm having the issue. The only difference I am seeing with your build settings is that I am on Unity 2018.1.5f1 (had the same problem with 2018.1.4f1).
Unity 2022.3.17f1
Dialogue System 2.2.44.1
OpenAI Addon 1.0.12
User avatar
Tony Li
Posts: 22058
Joined: Thu Jul 18, 2013 1:27 pm

Re: [2.0] IL2CPP issue on Windows x64

Post by Tony Li »

Hi Maxime,
mgregoirelds wrote: Mon Jun 18, 2018 8:35 pm Could it be that the main path for Dialogue System is not directly in the root as default when I'm installing the package? My install is in "Externals\Pixel Crushers\..." instead.
Yes. That's the issue. When possible, if something installs into Plugins, it will benefit you to keep it in Plugins.

Unity compiles in multiple passes. In the first pass, it compiles the C# scripts in Plugins into an assembly named "Assembly-CSharp-firstpass".

If nothing changes in Plugins, Unity can skip all those files when recompiling. This will make it much faster to recompile when you make changes your own code, which presumably isn't in Plugins.

In this case, the il2cpp build is failing because the Dialogue System's link.xml file expects the Dialogue System to be compiled into the Assembly-CSharp-firstpass assembly. But, since it's no longer inside Plugins, it's compiled into Assembly-CSharp instead. I recommend moving it back to Plugins. If you don't want to do that, you can edit link.xml and change "Assembly-CSharp-firstpass" to "Assembly-CSharp".
mgregoirelds
Posts: 106
Joined: Wed Aug 23, 2017 4:10 pm
Location: Canada

Re: [2.0] IL2CPP issue on Windows x64

Post by mgregoirelds »

Hello Tony,

I moved back the files to Plugins and that did it! I didn't even know that Plugins was a special Unity folder. Thanks a lot, it is now working great.
Unity 2022.3.17f1
Dialogue System 2.2.44.1
OpenAI Addon 1.0.12
User avatar
Tony Li
Posts: 22058
Joined: Thu Jul 18, 2013 1:27 pm

Re: [2.0] IL2CPP issue on Windows x64

Post by Tony Li »

Great! Thank for letting me know.
Post Reply