Search Unity

  1. Dismiss Notice
  2. All Pro and Enterprise subscribers: find helpful & inspiring creative, tech, and business know-how in the new Unity Success Hub. Sign in to stay up to date.
    Dismiss Notice
  3. Dismiss Notice

[5.2.1p3] Mono.Cecil.AssemblyResolutionException UnityEngine.UI.dll

Discussion in 'iOS and tvOS' started by AlienMe, Oct 17, 2015.

  1. AlienMe

    AlienMe

    Joined:
    Sep 16, 2014
    Posts:
    74
    Hi,

    I am getting this error on Unity 5.2.1p3. Basically, Unity is failing to resolve UnityEngine.UI.

    Any idea what could be causing this?

    Thanks.

     
  2. jrdmellow

    jrdmellow

    Joined:
    Jan 26, 2013
    Posts:
    2
    Getting this as well on two DLLs built with Visual Studio after updating to Unity 5.2.1f1.

    Doesn't seem to be causing a problem. I can still run and debug just fine (I had an issue where the debugger froze until reattached, but I'm not sure if it's related yet).
     
  3. Shonen

    Shonen

    Joined:
    May 13, 2015
    Posts:
    4
    Same here causing my cloud builds to fail
     
  4. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    281
    @AlienMe Can you post the full editor log?

    Thanks

    Adriano
     
  5. AlienMe

    AlienMe

    Joined:
    Sep 16, 2014
    Posts:
    74
    @Vagaus This is the editor log. We use VS 2013 + UnityVS.

    The error occurs when our game DLLs are built in VS, And Unity regains focus, and 'reimports' them.

     
  6. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    281
    Thanks for the log.

    This issue has already been fixed and should land in the next beta

    Adriano
     
  7. AlienMe

    AlienMe

    Joined:
    Sep 16, 2014
    Posts:
    74
    Great! Thanks.
     
  8. Max.Unity

    Max.Unity

    Joined:
    Oct 30, 2015
    Posts:
    1
    This issue still occurs in version 5.2.2f1 Personal.
    Is that expected or should have it been fixed in that version?
    Are there any workaround solutions or should we wait until 5.3 or 5.2.3?

    Thank you!
     
  9. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    281
    The fix is being back ported to 5.2. Don't know if it will make 5.2.3 though.

    Adriano
     
    Last edited: Nov 10, 2015
  10. ciathyza

    ciathyza

    Joined:
    Aug 16, 2015
    Posts:
    98
    I'm still getting this error in Unity 5.2.2f1 so I cannot build plugin DLLs from my asset.
     
  11. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    281
    Hi. This should be fixed in 5.2.2p4
     
  12. DomDom

    DomDom

    Joined:
    Oct 18, 2013
    Posts:
    33
    Is there a workaround? (or would going back to 5.2.0f fix it?)
    Because I'm getting that error in every project and I'm not able to test anything in Unity since I can't go into Playmode.
     
  13. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,300
    It also happens with 5.3. Like jrdmellow said, it doesn't seem to cause any actual problems for me, but I'd really prefer not to have errors generated.

    --Eric
     
  14. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    281
    @DomDom

    Hi
    Yes, there're some possible workarounds.

    You could try to copy the assembly that we are failing to resolve to the same place as UnityEngine.dll but I am not sure whether this would not cause other issues.

    There's another option that consist in replacing AssemblyUpdater.exe with a fake executable that just returns 1, but you need to understand that by doing this you are effectively disabling the updating mechanism for assemblies and you may get other errors @ build/runtime.

    I only recommend taking this approach as a last resort (which looks to be your case since it is blocking you); also, if you go through this route, consider updating to a newer version ASAP

    Adriano
     
  15. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    281
    @Eric5h5
    I think my changes only fixes this issue on Windows (QA reported today they can still reproduce this issue on OSX).

    I am investigating it now

    Adriano
     
  16. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,234
    @Vagaus I can confirm that sadly this issue still happens even on Windows, using Unity 5.2.3f1

    P.S. the problem seems to be related only to DLLs that reference UnityEngine.UI
     
  17. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    281
    @lzitmee

    The issue is related to *any* assembly in UnityExtensions being referenced in the project.

    Unfortunately the fix did not make its way into 5.2.3f1 but it is included in 5.2.3p1

    BTW: I've found the the problem on OSX. It is fixed and should land in the next patches.

    Adriano
     
  18. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,234
    Great! Thanks Adriano
     
  19. Roman-Ilyin

    Roman-Ilyin

    Joined:
    Oct 9, 2013
    Posts:
    21
    Hello. Same problem with 5.3.0f4
     
  20. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    281
    Hi. The patch is not included in 5.3.0f4. It will be include in a patch release in the near future (can't precise which patch release though, sorry)

    Adriano
     
  21. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    987
    Hi Adriano, Tested on 5.3.1f1 and the problem still persists. And worse is that in our case the assembly doesn't work and it's not functional at all. We are releasing a new product and planned its availability a week before January, now suddenly this happens which was nonexistent in 4.x versions.

    I think there are a lot of other developers releasing their packages bundled in DLL assemblies, with all being said, I really wonder: it is going to be a high priority subject for Unity 5 which is released for some months now...! Especially for the ones who need their code & stuff to be encoded & obfuscated like us.
     
  22. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    281
    @TerraUnity

    that is strange. The fix looks to be included in this version.

    Maybe you are experiencing a different (but similar) issue.

    Can you send me a Editor.log of one of those failures?

    Regarding being high priority to fix this, you can be sure it is.

    Adriano
     
  23. Sposito

    Sposito

    Joined:
    May 4, 2014
    Posts:
    16
    @Vagaus
    I am maybe having a similar problem, here is my log:

    My Unity Version: 5.3.0f4(Mac OSX)
    I updated Unity to 5.3.1f1 and the problem continues...
    Dll compiled from Mono Develop 5.9.6(Unity), I referenced UnityEditor and UnityEngine directly from Unity directory, as usual.

    [/S][/S]
     
    Last edited: Jan 10, 2016
  24. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    281
    @Sposito

    It looks like to me that your case is a different error; if possible create a small repro case and fill in a bug so I can investigate.

    Adriano
     
  25. Sposito

    Sposito

    Joined:
    May 4, 2014
    Posts:
    16
  26. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    281
    Hi @Sposito

    Sorry taking to long go get back to you.

    Your C# project (csproj) is specifying .Net 4.5 as the target which is not supported. Try changing it to 3.5 and this error should not happen anymore.

    Also this error looks to be happening when Unity tries to compile your (Unity) project. Can you post your Editor.log with the error for your real project? (You can send it directly to me if you don't want to post it here)

    Best

    Adriano
     
  27. SideShowBobMS

    SideShowBobMS

    Joined:
    Aug 17, 2013
    Posts:
    10
    Hi @Sposito and @Vagaus

    having the same issue here targeting .NET 3.5
    Same Error-Message on 5.3.0 (OSX)
    No Error-Message on 5.2.0 (OSX)
    No Error-Message on 5.3.3 (Win)

    Everything works fine, though the ErrorMessage, but that isn't a good start for someone with 5.3.0 opening our Asset the first time...
    So any updates about the workaround?

    Christian
     
  28. MikeEnoch

    MikeEnoch

    Joined:
    May 31, 2014
    Posts:
    6
  29. MikeEnoch

    MikeEnoch

    Joined:
    May 31, 2014
    Posts:
    6
    ... and it's still broken with 5.3.2f1 :(

    Completely fresh install this time, just to be sure it wasn't an update/upgrade problem.
     
  30. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    708
    @Vagaus, I'm the creator of the asset which is triggering Mike's import error above. Strangely, I'm unable to reproduce it at my end on Mac or PC on 5.3.1f1, and we've not had any other customers complaining of the issue (yet!).

    It's very similar to the error in the original post of this thread, except the missing assembly is System.Windows rather than UnityEngine.UI. The DLL which is triggering it is a WSA/WP8 DLL compiled in VS 2015, and it is correctly set as a plugin at Mike's end in the import settings (I've checked this myself). As far as I was aware, the Assembly Upgrader shouldn't be trying to upgrade platform-specific plugins.

    If you need any more information regarding the DLLs, let me know!
     
  31. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    281
    Hi @MikeEnoch

    This is a known issue that has been reported in a different thread: http://forum.unity3d.com/threads/un...ns-while-using-portable-class-library.366532/

    Notice that if the assemblies (.dll) in your project does not use any obsolete APIs (from Unity), this error is innocuous (it only means that the application that checks that failed, but since your assemblies does not have any obsolete API there's nothing to be updated)

    Note also that we don't have an ETA for the fix; all I can say is that it will be back ported to 5.3 and 5.4

    Best

    Adriano
     
    Last edited: Feb 5, 2016
  32. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    281
    @joeltebbett

    As commented in the other thread (the one I mentioned int he previous answer) I have a fix for this issue that will be pushed to 5.3 and 5.4 soon (don't have specific versions though)

    Best

    Adriano
     
  33. prabushan

    prabushan

    Joined:
    Mar 16, 2016
    Posts:
    8
    I am new to Unity, I have an existing project that I was able to open it Unity 5.3.3f and compile it. But since the web player doesn't work on browser, I was trying to build the project using the WebGL Settings.

    I am getting the following errors. Please some could take a look at it and help me out.


    Failed running C:\Program Files\Unity\Editor\Data\Tools/UnusedByteCodeStripper2/UnusedBytecodeStripper2.exe -out "C:\EBS_Original\EBS Unity\Temp\StagingArea\Data\Managed\tempStrip" -l none -c link -b False -x "C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\Whitelists\Core.xml" -f "C:\Program Files\Unity\Editor\Data\il2cpp\LinkerDescriptors" -x "C:\EBS_Original\EBS Unity/Temp/StagingArea/Data/methods_pointedto_by_uievents.xml" -x "C:\EBS_Original\EBS Unity\Temp\StagingArea\Data\preserved_derived_types.xml" -d "C:\EBS_Original\EBS Unity\Temp\StagingArea\Data\Managed" -a "C:\EBS_Original\EBS Unity\Temp\StagingArea\Data\Managed\Assembly-CSharp-firstpass.dll" -a "C:\EBS_Original\EBS Unity\Temp\StagingArea\Data\Managed\Assembly-CSharp.dll" -a "C:\EBS_Original\EBS Unity\Temp\StagingArea\Data\Managed\Assembly-UnityScript-firstpass.dll" -a "C:\EBS_Original\EBS Unity\Temp\StagingArea\Data\Managed\Bluedrop.EPSS3D.Common.dll" -a "C:\EBS_Original\EBS Unity\Temp\StagingArea\Data\Managed\Bluedrop.EPSS3D.Runtime.dll" -a "C:\EBS_Original\EBS Unity\Temp\StagingArea\Data\Managed\HighlightingSystem.dll" -a "C:\EBS_Original\EBS Unity\Temp\StagingArea\Data\Managed\NGUI.dll"

    stdout:
    Fatal error in Mono CIL Linker
    System.Exception: Error processing method: 'System.Void HighlightableObject::InitMaterials()' in assembly: 'HighlightingSystem.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve UnityEngine.ClothRenderer
    at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference)
    at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
    at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
    at Mono.Linker.Steps.MarkStep.ProcessQueue()
    --- End of inner exception stack trace ---
    at Mono.Linker.Steps.MarkStep.ProcessQueue()
    at Mono.Linker.Steps.MarkStep.Process()
    at Mono.Linker.Pipeline.Process(LinkContext context)
    at Mono.Linker.Driver.RunDriver(Driver driver)
    stderr:

    UnityEngine.Debug:LogError(Object)
    UnityEditorInternal.Runner:RunManagedProgram(String, String, String, CompilerOutputParserBase) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:94)
    UnityEditorInternal.AssemblyStripper:RunAssemblyLinker(IEnumerable`1, String&, String&, String, String) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:107)
    UnityEditorInternal.AssemblyStripper:StripAssembliesTo(String[], String[], String, String, String&, String&, String, IIl2CppPlatformProvider, IEnumerable`1, Boolean) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:100)
    UnityEditorInternal.AssemblyStripper:RunAssemblyStripper(String, IEnumerable, String, String[], String[], String, IIl2CppPlatformProvider, RuntimeClassRegistry, Boolean) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:204)
    UnityEditorInternal.AssemblyStripper:StripAssemblies(String, IIl2CppPlatformProvider, RuntimeClassRegistry, Boolean) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:131)
    UnityEditorInternal.IL2CPPBuilder:Run() (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:201)
    UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, IIl2CppPlatformProvider, Action`1, RuntimeClassRegistry, Boolean) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:135)
    UnityEditor.HostView:OnGUI()


    Thanks You
     
  34. Aiursrage2k

    Aiursrage2k

    Joined:
    Nov 1, 2009
    Posts:
    4,835
    AssemblyResolutionException: Failed to resolve assembly: 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
    Mono.Cecil.BaseAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference name, Mono.Cecil.ReaderParameters parameters)
    Mono.Cecil.BaseAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference name)
    Mono.Cecil.DefaultAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference name)
    UnityEditor.MonoAssemblyStripping+<CollectAssembliesRecursive>c__AnonStorey1.<>m__0 (Mono.Cecil.AssemblyNameReference a) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/MonoAssemblyStripping.cs:291)
    System.Linq.Enumerable+<CreateSelectIterator>c__Iterator10`2[Mono.Cecil.AssemblyNameReference,Mono.Cecil.AssemblyDefinition].MoveNext ()
    System.Linq.Enumerable+<CreateSelectManyIterator>c__Iterator12`2[Mono.Cecil.AssemblyDefinition,Mono.Cecil.AssemblyDefinition].MoveNext ()
    System.Collections.Generic.HashSet`1[Mono.Cecil.AssemblyDefinition].UnionWith (IEnumerable`1 other)
    UnityEditor.MonoAssemblyStripping.CollectAssembliesRecursive (IEnumerable`1 assemblies) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/MonoAssemblyStripping.cs:290)
    UnityEditor.MonoAssemblyStripping.GenerateLinkXmlToPreserveDerivedTypes (System.String stagingArea, System.String librariesFolder, UnityEditor.RuntimeClassRegistry usedClasses) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/MonoAssemblyStripping.cs:258)
    UnityEditorInternal.AssemblyStripper.RunAssemblyStripper (System.String stagingAreaData, IEnumerable assemblies, System.String managedAssemblyFolderPath, System.String[] assembliesToStrip, System.String[] searchDirs, System.String monoLinkerPath, IIl2CppPlatformProvider platformProvider, UnityEditor.RuntimeClassRegistry rcr, Boolean developmentBuild) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:176)
    UnityEditorInternal.AssemblyStripper.StripAssemblies (System.String stagingAreaData, IIl2CppPlatformProvider platformProvider, UnityEditor.RuntimeClassRegistry rcr, Boolean developmentBuild) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:128)
    UnityEditorInternal.IL2CPPBuilder.Run () (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:118)
    UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String tempFolder, System.String stagingAreaData, IIl2CppPlatformProvider platformProvider, System.Action`1 modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry, Boolean developmentBuild) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:32)
    PostProcessUAPIl2Cpp.RunIL2CPP () (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessUAPIl2Cpp.cs:92)
    PostProcessWinRT.Process () (at C:/buildslave/unity/build/PlatformDependent/WinRT/SharedSources/CSharp/PostProcessWinRT.cs:135)
    UnityEditor.WSA.BuildPostprocessor.PostProcess (BuildPostProcessArgs args) (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ExtensionModule.cs:155)
    UnityEditor.PostprocessBuildPlayer.Postprocess (BuildTarget target, System.String installPath, System.String companyName, System.String productName, Int32 width, Int32 height, System.String downloadWebplayerUrl, System.String manualDownloadWebplayerUrl, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.BuildReporting.BuildReport report) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:186)
    UnityEditor.HostView:OnGUI()
     
  35. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,173
    I get similar errors : Unity 5.5

    Failed running C:\Program Files\Unity5.5\Editor\Data\il2cpp/build/il2cpp.exe --convert-to-cpp --emit-null-checks --enable-array-bounds-check --enable-symbol-loading --extra-types.file="C:\Program Files\Unity5.5\Editor\Data\il2cpp\il2cpp_default_extra_types.txt" --assembly="D:\SubUWP\trunk\Temp\StagingArea\Data\Managed\Assembly-CSharp-firstpass.dll" --assembly="D:\SubUWP\trunk\Temp\StagingArea\Data\Managed\Assembly-CSharp.dll" --assembly="D:\SubUWP\trunk\Temp\StagingArea\Data\Managed\Assembly-UnityScript-firstpass.dll" --assembly="D:\SubUWP\trunk\Temp\StagingArea\Data\Managed\Assembly-UnityScript.dll" --assembly="D:\SubUWP\trunk\Temp\StagingArea\Data\Managed\UnityEngine.UI.dll" --assembly="D:\SubUWP\trunk\Temp\StagingArea\Data\Managed\DOTween.dll" --assembly="D:\SubUWP\trunk\Temp\StagingArea\Data\Managed\PlayMaker.dll" --assembly="D:\SubUWP\trunk\Temp\StagingArea\Data\Managed\UnityEngine.dll" --assembly="D:\SubUWP\trunk\Temp\StagingArea\Data\Managed\System.dll" --generatedcppdir="D:\SubUWP\trunk\Temp\StagingArea\Il2CppOutputProject\il2cppOutput"

    stdout:
    IL2CPP error (no further information about what managed code was being converted is available)
    Additional information: Build a development build for more information. Exception has been thrown by the target of an invocation.
    il2cpp.exe didn't catch exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: Unable to resolve [UnityEngine]UnityEngine.BitStream.
    at Unity.IL2CPP.Common.WindowsRuntimeAwareMetadataResolver.Resolve(TypeReference type)
    at Mono.Cecil.TypeReference.Resolve()
    at Unity.IL2CPP.Extensions.IsInterface(TypeReference type)
    at Unity.IL2CPP.GenericSharing.GenericSharingVisitor.Visit(Instruction instruction, Context context)
    at Unity.Cecil.Visitor.Visitor.Visit(MethodBody methodBody, Context context)
    at Unity.Cecil.Visitor.Visitor.Visit(MethodDefinition methodDefinition, Context context)
    at Unity.IL2CPP.GenericSharing.GenericSharingVisitor.Visit(MethodDefinition methodDefinition, Context context)
    at Unity.Cecil.Visitor.Visitor.Visit(TypeDefinition typeDefinition, Context context)
    at Unity.IL2CPP.GenericSharing.GenericSharingVisitor.Visit(TypeDefinition typeDefinition, Context context)
    at Unity.Cecil.Visitor.Visitor.Visit(ModuleDefinition moduleDefinition, Context context)
    at Unity.Cecil.Visitor.Visitor.Visit(AssemblyDefinition assemblyDefinition, Context context)
    --- End of inner exception stack trace ---
    at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
    at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    at Unity.Cecil.Visitor.Visitor.Visit[T](T node, Context context)
    at Unity.Cecil.Visitor.Extensions.DoAccept[T](T definition, Visitor visitor)
    at Unity.IL2CPP.AssemblyConverter.PreProcessStage(InflatedCollectionCollector& genericsCollectionCollector, TypeDefinition[]& allTypeDefinitions)
    at Unity.IL2CPP.AssemblyConverter.Apply()
    at Unity.IL2CPP.AssemblyConverter.ConvertAssemblies(NPath[] assemblies, NPath outputDir, NPath dataFolder)
    at Unity.IL2CPP.AssemblyConverter.ConvertAssemblies(IEnumerable`1 assemblyDirectories, IEnumerable`1 explicitAssemblies, NPath outputDir, NPath dataFolder)
    at il2cpp.Program.DoRun(String[] args)
    at il2cpp.Program.Run(String[] args)
    at il2cpp.Program.Main(String[] args)
    stderr:

    Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: Unable to resolve [UnityEngine]UnityEngine.BitStream.
    at Unity.IL2CPP.Common.WindowsRuntimeAwareMetadataResolver.Resolve(TypeReference type)
    at Mono.Cecil.TypeReference.Resolve()
    at Unity.IL2CPP.Extensions.IsInterface(TypeReference type)
    at Unity.IL2CPP.GenericSharing.GenericSharingVisitor.Visit(Instruction instruction, Context context)
    at Unity.Cecil.Visitor.Visitor.Visit(MethodBody methodBody, Context context)
    at Unity.Cecil.Visitor.Visitor.Visit(MethodDefinition methodDefinition, Context context)
    at Unity.IL2CPP.GenericSharing.GenericSharingVisitor.Visit(MethodDefinition methodDefinition, Context context)
    at Unity.Cecil.Visitor.Visitor.Visit(TypeDefinition typeDefinition, Context context)
    at Unity.IL2CPP.GenericSharing.GenericSharingVisitor.Visit(TypeDefinition typeDefinition, Context context)
    at Unity.Cecil.Visitor.Visitor.Visit(ModuleDefinition moduleDefinition, Context context)
    at Unity.Cecil.Visitor.Visitor.Visit(AssemblyDefinition assemblyDefinition, Context context)
    --- End of inner exception stack trace ---
    at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
    at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    at Unity.Cecil.Visitor.Visitor.Visit[T](T node, Context context)
    at Unity.Cecil.Visitor.Extensions.DoAccept[T](T definition, Visitor visitor)
    at Unity.IL2CPP.AssemblyConverter.PreProcessStage(InflatedCollectionCollector& genericsCollectionCollector, TypeDefinition[]& allTypeDefinitions)
    at Unity.IL2CPP.AssemblyConverter.Apply()
    at Unity.IL2CPP.AssemblyConverter.ConvertAssemblies(NPath[] assemblies, NPath outputDir, NPath dataFolder)
    at Unity.IL2CPP.AssemblyConverter.ConvertAssemblies(IEnumerable`1 assemblyDirectories, IEnumerable`1 explicitAssemblies, NPath outputDir, NPath dataFolder)
    at il2cpp.Program.DoRun(String[] args)
    at il2cpp.Program.Run(String[] args)
    at il2cpp.Program.Main(String[] args)

    UnityEngine.Debug:LogError(Object)
    UnityEditorInternal.Runner:RunManagedProgram(String, String, String, CompilerOutputParserBase, Action`1) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:96)
    UnityEditorInternal.IL2CPPBuilder:RunIl2CppWithArguments(List`1, Action`1, String) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:281)
    UnityEditorInternal.IL2CPPBuilder:ConvertPlayerDlltoCpp(ICollection`1, String, String) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:272)
    UnityEditorInternal.IL2CPPBuilder:Run() (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:126)
    UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, String, IIl2CppPlatformProvider, Action`1, RuntimeClassRegistry, Boolean) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:32)
    PostProcessUAPIl2Cpp:RunIL2CPP() (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessUAPIl2Cpp.cs:92)
    PostProcessWinRT:process() (at C:/buildslave/unity/build/PlatformDependent/WinRT/SharedSources/CSharp/PostProcessWinRT.cs:135)
    UnityEditor.HostView:OnGUI()
     
  36. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    5,250
    @castor76

    This looks like a bug on the Unity side. Can you submit a bug report and let me know the bug number? We will correct it.
     
  37. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    5,250
  38. developersice

    developersice

    Joined:
    Nov 25, 2016
    Posts:
    36
    We are having the exact same issue in our cloud build, there have been non-stop errors and considering we are paying for a subscription to use this feature that doesn't work, we aren't too chuffed. Our app builds perfectly on Windows 64 bit standalone from our computers, just cloud build has two of these errors which aren't even highlighted in red as errors on our build logs.
    18704: [Unity] System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
     
  39. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    5,250
    @developersice

    There are actually a few different errors discussed in this thread, I think.

    Your error message indicates that the System.Runtime.dll assembly cannot be located. This error actually makes sense, as System.Runtime.dll is not support by Unity yet, as it is a part of the .Net Standard API. We're actively working on support for that, but it has not been released.

    So, which version of Unity are you using? Also, have you done anything special to the Unity installation on your computers to make this work properly? I'm surprised that it works at all!
     
  40. developersice

    developersice

    Joined:
    Nov 25, 2016
    Posts:
    36
    Within a app we are developing, we are making use of System.Runtime.dll to communicate with a database that runs in a Windows Service, which has run perfectly fine in builds of the app on the majority of Unity 5.0 versions up until 5.6.2f1.

    Does the cloud build consciously exclude it as it is not part of the .Net Standard API and why do the standard installations of Unity we have on 5 computers have the ability to build and run the app from the same repository/engine version that the cloud build service uses?

    I would be interested in finding a way for cloud build to allow us to continue pushing our changes to a cloud based build of the app rather than us exporting it locally from our office computers.
     
  41. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    5,250
    @developersice

    Interesting, I'm surprised that System.Runtime.dll or any other assemblies from .Net Standard work with Unity 5.6.2f1.

    I don't believe that could build consciously excludes this. However, Unity 5.6.2f1 does not support building with any assemblies from .Net Standard. So I'm unsure how this works even on your local machines. Does the project include an mcs.rsp file to indicate to the C# compiler that it should reference System.Runtime.dll? If so, where is the System.Runtime.dll file located?
     
  42. developersice

    developersice

    Joined:
    Nov 25, 2016
    Posts:
    36
    Just had a quick search and could find no such mcs.rsp file as such or anything similar, shall we reproduce with a simple script created with a reference to the System.Runtime.dll and build?

    We have not got the system.runtime.dll file included within our project, I believe it just calls out for it?

    Do you think including said system.runtime.dll file in our build would maybe alleviate the cloud build issue we are having or is it simply written off in cloud build specifically?
     
  43. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    5,250
    That might fix the cloud build issue, as it will only build what is in your project, and nothing on cloud build will find System.Runtime.dll elsewhere. But I don't think that is necessarily a good idea. I'd instead like to determine where the System.Runtime.dll is coming from, and why it works. The Mono runtime used in Unity at 5.6 should not be able to execute code in System.Runtime.dll!

    This is the key question to answer. I don't believe that the C# compiler should be looking elsewhere for this assembly.

    We can take a look at this project in a bug report if you are able to submit it to us.
     
  44. developersice

    developersice

    Joined:
    Nov 25, 2016
    Posts:
    36
    We are going to try adding the System.Runtime.dll to the build branch of our repo and see if it fixes the cloud build errors we are having.

    We had another issue with an error stating
    37949: [Unity] System.Windows.Forms.dll assembly is referenced by user code, but is not supported on StandaloneWindows64 platform. Various failures might follow.

    ^Despite us not referencing it in code anywhere at all.. I removed it from our 'References' for the project in Visual Studio under the project .sln file but I realised we weren't pushing that into the repository anyway - a new one would be generated when the unity project is opened for the first time on any machine. But anyway, back to the system.runtime issue..

    Would be able to provide the read only branch of our repository to you as part of a support case, would you be able to contact us directly through our account email so that we can arrange an investigation into the issue? Ultimately we need to be able to use cloud build as it is going to be of importance to this project and as we are using a subscription for the cloud build, we would really like it to work!

    Rob
     
  45. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    5,250
    Yes, if you submit a bug report, we can communicate about getting the project via the email associated with your account. If you work with a Unity support representative for other issues, it might be better to communicate via that person instead of a bug report.

    If you do submit a bug report, ping me privately on the forums with the bug report number, and I'll be able to route it properly.
     
  46. aidesigner

    aidesigner

    Joined:
    May 2, 2012
    Posts:
    121
    The code segments in this post have references to NLog.dll (Just search), which from another post had a dependency issue with System.Windows.Forms.dll. This post diverges in a few places, but I suspect a dependency chain starting with a user included dll (i.e. NLog.dll) is leading to the unexpected dll requirement.
     
  47. gonzalezc9999

    gonzalezc9999

    Joined:
    Feb 20, 2018
    Posts:
    2
    I got this blank error in the newest version.
     
  48. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    281
  49. e-sollinger

    e-sollinger

    Joined:
    Dec 30, 2016
    Posts:
    12
    Attaching my log ... having trouble and just downloaded the latest of everything today, then rebooted computer, but still getting this error.


    UNetWeaver error: Exception :Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'LuminUnity, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
    at Mono.Cecil.BaseAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference name, Mono.Cecil.ReaderParameters parameters) [0x00000] in <filename unknown>:0
    at Mono.Cecil.BaseAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference name) [0x00000] in <filename unknown>:0
    at Mono.Cecil.DefaultAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference name) [0x00000] in <filename unknown>:0
    at Mono.Cecil.MetadataResolver.Resolve (Mono.Cecil.TypeReference type) [0x00000] in <filename unknown>:0
    at Mono.Cecil.ModuleDefinition.Resolve (Mono.Cecil.TypeReference type) [0x00000] in <filename unknown>:0
    at Mono.Cecil.TypeReference.Resolve () [0x00000] in <filename unknown>:0
    at Unity.UNetWeaver.NetworkBehaviourProcessor.ProcessSyncVars () [0x003cc] in C:\buildslave\unity\build\Extensions\Networking\Weaver\UNetBehaviourProcessor.cs:2258
    at Unity.UNetWeaver.NetworkBehaviourProcessor.Process () [0x00059] in C:\buildslave\unity\build\Extensions\Networking\Weaver\UNetBehaviourProcessor.cs:55
    at Unity.UNetWeaver.Weaver.ProcessNetworkBehaviourType (Mono.Cecil.TypeDefinition td) [0x00093] in C:\buildslave\unity\build\Extensions\Networking\Weaver\UNetWeaver.cs:1142
    at Unity.UNetWeaver.Weaver.CheckNetworkBehaviour (Mono.Cecil.TypeDefinition td) [0x000a0] in C:\buildslave\unity\build\Extensions\Networking\Weaver\UNetWeaver.cs:1681
    at Unity.UNetWeaver.Weaver.Weave (System.String assName, IEnumerable`1 dependencies, IAssemblyResolver assemblyResolver, System.String unityEngineDLLPath, System.String unityUNetDLLPath, System.String outputDir) [0x000ab] in C:\buildslave\unity\build\Extensions\Networking\Weaver\UNetWeaver.cs:1791
     

    Attached Files:

  50. e-sollinger

    e-sollinger

    Joined:
    Dec 30, 2016
    Posts:
    12

    RESOLVED:
    Problem was I had LuminSDK unitypackage 0.13.0 in the project from before, and just overwrote it with 0.16.0 ... so needless to say, just wiping out the MagicLeap directory, and re-importing the 0.16.0 fixed the problem.
     
unityunity