System.ArgumentException: Unable to find the file for the assembly named 'UnityEngine' specified in

Hi,

I’ve successfully setup a Jenkins server to build the iOS version of our game. It has been working flawless
until we updated to the latest Unity 5.5.0 p3.

Now we get a linker error that it can not find the assembly “UnityEngine”. Please see the log below

DisplayProgressbar: Fetching assembly references
DisplayProgressbar: Building Player
UserBlackList: /Users/Shared/Jenkins/Home/workspace/BadMen/Assets/GameSparks/link.xml
Invoking UnusedByteCodeStripper2 with arguments: --api NET_2_0_Subset -out “/Users/Shared/Jenkins/Home/workspace/BadMen/Temp/StagingArea/Data/Managed/tempStrip” -l none -c link -b False -x “/Applications/Unity/PlaybackEngines/iOSSupport/Whitelists/Core.xml” -f “/Applications/Unity/Unity.app/Contents/il2cpp/LinkerDescriptors” -x “/Users/Shared/Jenkins/Home/workspace/BadMen/Temp/StagingArea/Data/Managed/…/platform_native_link.xml” -x “/Users/Shared/Jenkins/Home/workspace/BadMen/Temp/StagingArea/Data/methods_pointedto_by_uievents.xml” -x “/Users/Shared/Jenkins/Home/workspace/BadMen/Temp/StagingArea/Data/preserved_derived_types.xml” -x “/Users/Shared/Jenkins/Home/workspace/BadMen/Assets/GameSparks/link.xml” -d “/Users/Shared/Jenkins/Home/workspace/BadMen/Temp/StagingArea/Data/Managed”
/Applications/Unity/Unity.app/Contents/Tools/UnusedByteCodeStripper2/UnusedBytecodeStripper2.exe exited after 168 ms.
Failed running /Applications/Unity/Unity.app/Contents/Tools/UnusedByteCodeStripper2/UnusedBytecodeStripper2.exe --api NET_2_0_Subset -out “/Users/Shared/Jenkins/Home/workspace/BadMen/Temp/StagingArea/Data/Managed/tempStrip” -l none -c link -b False -x “/Applications/Unity/PlaybackEngines/iOSSupport/Whitelists/Core.xml” -f “/Applications/Unity/Unity.app/Contents/il2cpp/LinkerDescriptors” -x “/Users/Shared/Jenkins/Home/workspace/BadMen/Temp/StagingArea/Data/Managed/…/platform_native_link.xml” -x “/Users/Shared/Jenkins/Home/workspace/BadMen/Temp/StagingArea/Data/methods_pointedto_by_uievents.xml” -x “/Users/Shared/Jenkins/Home/workspace/BadMen/Temp/StagingArea/Data/preserved_derived_types.xml” -x “/Users/Shared/Jenkins/Home/workspace/BadMen/Assets/GameSparks/link.xml” -d “/Users/Shared/Jenkins/Home/workspace/BadMen/Temp/StagingArea/Data/Managed”

stdout:
Fatal error in Mono CIL Linker
System.ArgumentException: Unable to find the file for the assembly named ‘UnityEngine’ specified in link file ‘/Applications/Unity/PlaybackEngines/iOSSupport/Whitelists/Core.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: ‘mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’
at Mono.Linker.LinkContext.Resolve (IMetadataScope scope) <0x103ac9e20 + 0x000e9> in :0
at Mono.Linker.Steps.ResolveFromXmlStep.ProcessReferences (Mono.Cecil.AssemblyDefinition assembly, Mono.Linker.LinkContext context) <0x103ae1980 + 0x0007a> in :0
at Mono.Linker.Steps.ResolveFromXmlStep.GetAssembly (Mono.Linker.LinkContext context, System.String assemblyName) <0x103ac95c0 + 0x0004e> in :0
at Mono.Linker.Steps.ResolveFromXmlStep.ProcessAssemblies (Mono.Linker.LinkContext context, System.Xml.XPath.XPathNodeIterator iterator) <0x103ac8510 + 0x0009e> in :0
— End of inner exception stack trace —
at Mono.Linker.Steps.ResolveFromXmlStep.ProcessAssemblies (Mono.Linker.LinkContext context, System.Xml.XPath.XPathNodeIterator iterator) <0x103ac8510 + 0x003b0> in :0
at Mono.Linker.Steps.ResolveFromXmlStep.Process () <0x103ac7b40 + 0x0008b> in :0
at Mono.Linker.Steps.BaseStep.Process (Mono.Linker.LinkContext context) <0x103ac7a10 + 0x0006b> in :0
at Mono.Linker.Pipeline.Process (Mono.Linker.LinkContext context) <0x103ac6ad0 + 0x000e6> in :0
at Mono.Linker.Driver.Run (IEqualityComparer1 typeComparer, IEqualityComparer1 methodComparer) <0x100b43520 + 0x00be7> in :0
at Mono.Linker.Driver.RunDriverWithErrorHandling (Mono.Linker.Driver driver, IEqualityComparer1 typeComparer, IEqualityComparer1 methodComparer) <0x100b434d0 + 0x00026> in :0
at Mono.Linker.Driver.RunDriver (Mono.Linker.Driver driver, IEqualityComparer1 typeComparer, IEqualityComparer1 methodComparer) <0x100b433e0 + 0x0003b> in :0
stderr:

Is this something you can reproduce independent of Jenkins? I’d like to have a look at it here in a bug report. The UnityEngine assembly certainly should not be missing!

Hi,

I’ve tried reproducing it, but the game builds fine in the editor. I also tested yesterday to setup a “test” project with Jenkins and the latest Unity patch release, and everything is working with that project. So it seems to be isolated to a this single project.

I can post the entire log, maybe you can see anything that i’m missing.

Thanks, that might be the best option to track down the cause then. Also, can you post the contents of the /Applications/Unity/PlaybackEngines/iOSSupport/Whitelists/Core.xml file? That should match the version we ship with Unity 5.5.0p3, but I would like to confirm that.

Here is the Core.xml and attached is the log file

2907372–214219–Log.txt (1.22 MB)

It looks like the mscorlib.dll file cannot be located as well, so something is really wrong here. I’m not yet sure about the cause, but here are a few things to check:

  • Is the build process setting any MONO_ environment variables (like MONO_PATH)? These can change the location where managed assemblies like mscorlib.dll are located.
  • Does the same build machine configuration work for Unity 5.4?
  • Does the same build machine configuration work for earlier versions of Unity 5.5?
  • Can you confirm that all of the files in the Unity installation are the same on the local machine where this works and the build machine where this fails?

Let’s start here and see what we can find.

I’m also seeing this error since upgrading to 5.5.0f3. Did this problem ever get resolved? @JoshPeterson , is it possible I could show you my build log as well?

@rustofelees

This has not been resolved. I’ll be happy to have a look at a build log if you can provide it.

My developer team name is rustofelees. Is that enough for you to inspect the build log?

@rustofelees

Is this on Unity Cloud Build? If so, I don’t think the team name is enough. Can you send me a link to the specific build? Please use a private message on the forums.

If anyone sees this in the future, and has a similar problem, try switching from .Net subset to .Net. After doing so I was successfully able to build for IOS again.

It also looks like Unity is not handling the ProBuilder asset store package properly. We’re still investigating the issue, but you may be able to work around the problem by removing ProBuilder if it is in your project and you do not need it.

If anyone else comes across this, the solution in this thread solved it for me: