Search Unity

IL2CPP error - Failed to resolve assembly: 'netstandard, Version=2.0.0.0...'

Discussion in 'WebGL' started by grizzlycorv, Jan 20, 2021.

  1. grizzlycorv

    grizzlycorv

    Joined:
    Nov 9, 2018
    Posts:
    18
    I am using the cloud build of Unity and try to do a WebGL build and get the following error message:

    I'm having a really hard time trying to figure out which assembly is responsible for the error so that I can solve the problem. I will be glad to receive any help.
     
  2. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    5,561
    Can you build this project locally? Can you build an empty project locally?

    This almost most looks like some Unity installation issue, but I would not expect that on a cloud build.
     
  3. grizzlycorv

    grizzlycorv

    Joined:
    Nov 9, 2018
    Posts:
    18
    Hey Josh, thank you for your response.

    Building the Project for WebGL locally throws the exact same exception.
    Building an empty Project for WebGL works locally.
    Building the Project for other Platforms (Windows, Linux, Mac) works on both, Cloud Build and locally.
     
  4. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    5,561
    Ok, a few more questions then:

    Is there some assembly in the project that is built against .NET Standard 2.0?

    What is the Scripting Backend setting for these platforms (in the Player Settings)? Is it Mono or IL2CPP?
     
  5. grizzlycorv

    grizzlycorv

    Joined:
    Nov 9, 2018
    Posts:
    18
    There are multiple assemblies that are built against net standard 2.0.3 and Scripting Backend is Mono.
     
  6. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    5,561
    Thanks for the details.

    First of all, this error will only happen with IL2CPP, so that is likely why on WebGL fails, as it uses IL2CPP.

    Send, what is the Api Compatibility Level setting in the Player Settings? I believe it needs to be .Net Standard 2.0 in order for assemblies built against .Net Standard 2.0 to work properly.
     
    grizzlycorv likes this.
  7. grizzlycorv

    grizzlycorv

    Joined:
    Nov 9, 2018
    Posts:
    18
    For any reason it's the opposite, when building with Api Compatibility Level .NET Standard 2.0 the error is thrown, building with .Net 4.x works.
     
  8. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    5,561
    That is odd. Is this a project that you can submit with a bug report?
     
  9. grizzlycorv

    grizzlycorv

    Joined:
    Nov 9, 2018
    Posts:
    18
    How do I do that? Do I have to upload the project somewhere?
     
  10. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    5,561
  11. osimaleki

    osimaleki

    Joined:
    Jan 15, 2020
    Posts:
    35
    Hi, Was this resolved? Any insights would be appreciated. If I run on Mondo/Arm7 it builds fine. Running IL2CPP/ARM64 I get similar error.

    My specific error is: "Failed to resolve assembly: 'Unity.RuntimeSceneSerialization, Version=0.0.0.0..."

    I should add:

    - I am using the preview package UI Builder
    - I am using MARS/AR foundations so I need IL2CPP/ARM64

    Thank you!
     
  12. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    5,561
    Can you provide the full call stack you get with this error? It looks like this might be a different issue.
     
  13. osimaleki

    osimaleki

    Joined:
    Jan 15, 2020
    Posts:
    35
    I wondered if that was the case. Please see below and let me know if you would like me to open another thread. Appreciate the help!

    Exception: Failed running D:\UnityEditors\2020.3.0f1\Editor\Data\il2cpp\build/deploy/netcoreapp3.1/UnityLinker.exe @D:/XR/WanderingStar/Temp/StagingArea/assets/bin/Data/Managed/response.rsp

    stdout:
    Fatal error in Unity CIL Linker
    Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'Unity.RuntimeSceneSerialization, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
    at Unity.Linker.EngineStripping.EngineModule.ResolvedReferences(UnityLinkContext context)+MoveNext()
    at Unity.Linker.Steps.Marking.EngineStrippingMarking.MarkModuleReferences(EngineModule module, Boolean markEngineModule)
    at Unity.Linker.Steps.Marking.EngineStrippingMarking.MarkModule(EngineModule module, Boolean markEngineModule)
    at Unity.Linker.Steps.Marking.EngineStrippingMarking.MarkModuleOf(IMemberDefinition member)
    at Unity.Linker.Steps.Marking.EngineStrippingMarking.DoAdditionalFieldProcessing(FieldDefinition field)
    at Unity.Linker.Steps.UnityMarkStep.DoAdditionalFieldProcessing(FieldDefinition field)
    at Mono.Linker.Steps.MarkStep.MarkField(FieldDefinition field)
    at Mono.Linker.Steps.MarkStep.MarkField(FieldReference reference)
    at Unity.Linker.Steps.UnityMarkStep.Unity.Linker.Steps.Marking.IMarkStepCallbacks.MarkField(FieldReference reference)
    at Unity.Linker.Steps.Marking.BaseMarkStepExtension.MarkField(FieldReference reference)
    at Unity.Linker.Steps.Marking.MonoBehaviourMarking.MarkNeededFields(TypeDefinition type)
    at Unity.Linker.Steps.Marking.MonoBehaviourMarking.DoAdditionalTypeProcessing(TypeDefinition type)
    at Unity.Linker.Steps.UnityMarkStep.DoAdditionalTypeProcessing(TypeDefinition type)
    at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference)
    at Mono.Linker.Steps.MarkStep.MarkField(FieldDefinition field)
    at Mono.Linker.Steps.MarkStep.MarkField(FieldReference reference)
    at Unity.Linker.Steps.UnityMarkStep.Unity.Linker.Steps.Marking.IMarkStepCallbacks.MarkField(FieldReference reference)
    at Unity.Linker.Steps.Marking.BaseMarkStepExtension.MarkField(FieldReference reference)
    at Unity.Linker.Steps.Marking.MonoBehaviourMarking.MarkNeededFields(TypeDefinition type)
    at Unity.Linker.Steps.Marking.MonoBehaviourMarking.DoAdditionalTypeProcessing(TypeDefinition type)
    at Unity.Linker.Steps.UnityMarkStep.DoAdditionalTypeProcessing(TypeDefinition type)
    at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference)
    at Mono.Linker.Steps.MarkStep.MarkField(FieldDefinition field)
    at Mono.Linker.Steps.MarkStep.MarkEntireType(TypeDefinition type)
    at Mono.Linker.Steps.MarkStep.MarkEntireAssembly(AssemblyDefinition assembly)
    at Mono.Linker.Steps.MarkStep.InitializeAssembly(AssemblyDefinition assembly)
    at Unity.Linker.Steps.UnityMarkStep.InitializeAssembly(AssemblyDefinition assembly)
    at Mono.Linker.Steps.MarkStep.Initialize()
    at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
    at Unity.Linker.Steps.UnityMarkStep.Process(LinkContext context)
    at Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep step)
    at Unity.Linker.UnityPipeline.ProcessStep(LinkContext context, IStep step)
    at Mono.Linker.Pipeline.Process(LinkContext context)
    at Unity.Linker.UnityDriver.UnityRun(ILogger customLogger)
    at Unity.Linker.UnityDriver.RunDriverWithoutErrorHandling(ILogger customLogger)
    at Unity.Linker.UnityDriver.RunDriver()
    stderr:

    UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at <50f55621a2ca4f31a35283e2979a8bf5>:0)
    UnityEditorInternal.Runner.RunNetCoreProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action`1[T] setupStartInfo) (at <50f55621a2ca4f31a35283e2979a8bf5>:0)
    UnityEditorInternal.AssemblyStripper.RunAssemblyLinker (System.Collections.Generic.IEnumerable`1[T] args, System.String& out, System.String& err, System.String linkerPath, System.String workingDirectory) (at <50f55621a2ca4f31a35283e2979a8bf5>:0)
    UnityEditorInternal.AssemblyStripper.StripAssembliesTo (System.String outputFolder, System.String& output, System.String& error, System.Collections.Generic.IEnumerable`1[T] linkXmlFiles, UnityEditorInternal.UnityLinkerRunInformation runInformation) (at <50f55621a2ca4f31a35283e2979a8bf5>:0)
    UnityEditorInternal.AssemblyStripper.RunAssemblyStripper (UnityEditorInternal.UnityLinkerRunInformation runInformation) (at <50f55621a2ca4f31a35283e2979a8bf5>:0)
    UnityEditorInternal.AssemblyStripper.StripAssemblies (System.String managedAssemblyFolderPath, UnityEditorInternal.BaseUnityLinkerPlatformProvider unityLinkerPlatformProvider, UnityEditorInternal.IIl2CppPlatformProvider il2cppPlatformProvider, UnityEditor.RuntimeClassRegistry rcr, UnityEditor.ManagedStrippingLevel managedStrippingLevel) (at <50f55621a2ca4f31a35283e2979a8bf5>:0)
    UnityEditorInternal.IL2CPPBuilder.Run () (at <50f55621a2ca4f31a35283e2979a8bf5>:0)
    UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String tempFolder, System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action`1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (at <50f55621a2ca4f31a35283e2979a8bf5>:0)
    UnityEditor.Android.PostProcessor.Tasks.RunIl2Cpp.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <2c6e9a95f1dd4e06ad71afcd2684dcb7>:0)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <2c6e9a95f1dd4e06ad71afcd2684dcb7>:0)
    UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <2c6e9a95f1dd4e06ad71afcd2684dcb7>:0)
    UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <2c6e9a95f1dd4e06ad71afcd2684dcb7>:0)
    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 <50f55621a2ca4f31a35283e2979a8bf5>:0)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr, Boolean&)
     
  14. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    5,561
    Yes, this looks like a different issue. Can you start a new thread?
     
  15. osimaleki

    osimaleki

    Joined:
    Jan 15, 2020
    Posts:
    35
    Stygian65 likes this.
  16. isaac-ashdown

    isaac-ashdown

    Joined:
    Jan 30, 2019
    Posts:
    69
    Re: the original issue with the "Failed to resolve assembly: 'netstandard, Version=2.0.0.0...'" error, I was able to resolve this by adding a link.xml file to my Assets folder with this:

    Code (CSharp):
    1. <linker>
    2.     <assembly fullname="netstandard" preserve="all"/>
    3. </linker>
     
  17. m8lee

    m8lee

    Joined:
    Nov 11, 2020
    Posts:
    1
    I seemed to have resolved the error by using .Net 4.x and Mono as well
     
  18. Stygian65

    Stygian65

    Joined:
    Aug 27, 2017
    Posts:
    16
    Thank you for this.

    For future devs trying to figure this out, the error I got was:
    unity (0,0): error Mono.Cecil.ResolutionException: Failed to resolve System.Text.RegularExpressions.RegexOptions


    Removing the MARS preview packages fixed it.
     
unityunity