Search Unity

Window 64-bit build fails - Can't find Unity libraries

Discussion in 'Unity Build Automation' started by Corvwyn, Nov 2, 2017.

  1. Corvwyn

    Corvwyn

    Joined:
    Nov 15, 2013
    Posts:
    114
    Description of issue:
    My win 64 build fails on Cloud Build stating that it can't find any of the Unity libraries. I'm using the .NET 4.6 scripting runtime.

    Unity version: 2017.2.0f3

    Source control: Git w/ LFS with Visual Studio Team Services.

    Local build platform: Windows 64-bit

    Build target: Windows 64-bit

    Relevant plugins being used (i.e. Google Play Game Services, other plugins that may perform automatic post-build behaviors)
    None.

    Project name: Tavern

    Build log (relevant chunk):

    Code (CSharp):
    1. Error: System.Exception: 'UnityEngine.MonoBehaviour' was not found in any of the referenced assemblies
    2. 28094: [Unity]   at us.UnityScriptCompilerFactoryModule.resolveType (System.Object assemblies, System.String typeName) [0x00089] in <c640d65315cc44779b32219854912c61>:0
    3. 28095: [Unity]   at us.UnityScriptCompilerFactory.FromCommandLineOptions (us.CommandLineOptions options) [0x002a8] in <c640d65315cc44779b32219854912c61>:0
    4. 28096: [Unity]   at us.UsModule.compile (us.CommandLineOptions options) [0x00000] in <c640d65315cc44779b32219854912c61>:0
    5. 28097: [Unity]   at us.UsModule.runWithCommandLine (System.String[] commandLine) [0x0001d] in <c640d65315cc44779b32219854912c61>:0
    6. 28098: [Unity]   at us.UsModule.Main (System.String[] argv) [0x00000] in <c640d65315cc44779b32219854912c61>:0
    7. 28099: [Unity] (Filename:  Line: 0)
    8. 28100: [Unity] Error building Player because scripts had compiler errors
    Code (CSharp):
    1. 16618: [Unity] -----CompilerOutput:-stdout--exitcode: 1--compilationhadfailure: True--outfile: Temp/Assembly-CSharp.dll
    2. 16619: [Unity] Compilation failed: 3821 error(s), 2 warnings
    3. 16620: [Unity] Assets/3rdParty/Cinemachine/Base/Runtime/Behaviours/CinemachineBrain.cs(5,19): error CS0234: The type or namespace name `Events' does not exist in the namespace `UnityEngine'. Are you missing an assembly reference?
    4. 16621: [Unity] Assets/3rdParty/Cinemachine/Base/Runtime/Behaviours/CinemachineCollider.cs(4,19): error CS0234: The type or namespace name `Serialization' does not exist in the namespace `UnityEngine'. Are you missing an assembly reference?
    Does it build locally from a fresh checkout?
    Yes. Local build from a fresh git clone is ok with no errors.

    I do get the error below in the editor, starting with 2017.2.0f3 however, but I can build successfully. I have yet to find out why.

    Code (CSharp):
    1. scriptParameterClass != NULL
     
    MathiasK likes this.
  2. dannyd

    dannyd

    Unity Technologies

    Joined:
    Jun 3, 2014
    Posts:
    785
    This is being investigated. Seems all builds targeting windows / .NET 4.6 in 2017.2.0+ in UCB are running into this currently. Will report back when I have more info.
     
  3. Corvwyn

    Corvwyn

    Joined:
    Nov 15, 2013
    Posts:
    114
    Aha. I expected it might have something to do with .NET 4.6. Thanks for the info.
     
    PetrisPeper likes this.
  4. Corvwyn

    Corvwyn

    Joined:
    Nov 15, 2013
    Posts:
    114
    @dannyd It's not production critical or anything for me, but any progress? Maybe you should give some kind of warning in the error log when building for Windows and .NET 4.6, or a service status for Cloud Build? There are probably more people wondering why their builds are failing.
     
  5. Corvwyn

    Corvwyn

    Joined:
    Nov 15, 2013
    Posts:
    114
    Not to nag or anything, but my .NET 4.6 windows builds have been failing for 14 days or so now.

    It would be useful if I could give out download links for testing, without downgrading my .NET version.
     
    MathiasK likes this.
  6. AlexisDow

    AlexisDow

    Joined:
    Mar 7, 2017
    Posts:
    9
    We have the same problem here ! All Windows builds are just failing on UCB while they locally do fine !
    Please advise :)
     
  7. dannyd

    dannyd

    Unity Technologies

    Joined:
    Jun 3, 2014
    Posts:
    785
    I understand it's frustrating waiting - sorry to say I don't have an update here yet. This is something we are still actively working on tracking down and getting fixed in the Unity Cloud Build environment.

    And to address your concern specifically @Corvwyn, you can actually upload local builds into your Cloud Build history if you just need to give out download links (there is an "Upload" button at the top of the history page). I realize that isn't ideal, but it's an option for now.
     
    MathiasK likes this.
  8. Corvwyn

    Corvwyn

    Joined:
    Nov 15, 2013
    Posts:
    114
    Thanks for the update. Best of luck with the solution.
     
    MathiasK likes this.
  9. MathiasK

    MathiasK

    Joined:
    Jun 22, 2015
    Posts:
    2
    Just chipping in that I am also awaiting a a resolution to this issue
     
  10. haraldreingruber

    haraldreingruber

    Joined:
    Sep 29, 2016
    Posts:
    6
    We are experiencing the same issue. Looking forward to status updates.
     
  11. chrishdev

    chrishdev

    Joined:
    Jul 18, 2017
    Posts:
    2
    +1 from me as well for a fix please - as we use .net 4 not older .net for our project, cloud build has never successfully built for me. If there is a workaround in terms of a way we can make the project build that would be useful while we are waiting for a fix - thanks!
     
  12. haraldreingruber

    haraldreingruber

    Joined:
    Sep 29, 2016
    Posts:
    6
    @dannyd are you tracking this bug already in the Unity Issue Tracker?
     
  13. haraldreingruber

    haraldreingruber

    Joined:
    Sep 29, 2016
    Posts:
    6
    Any updates so far @dannyd, or are there any other channels where we might get informed about beta versions or patch releases to test?
     
  14. SentryGames

    SentryGames

    Joined:
    Jun 4, 2014
    Posts:
    24
    I have the same issue ... and same question than haraldreingruber, a way to follow evolution ?
     
  15. dannyd

    dannyd

    Unity Technologies

    Joined:
    Jun 3, 2014
    Posts:
    785
    We are working on a fix on the UCB side as opposed to needing a new patch release of Unity itself (as far as we can tell this generally only affects our build environment). Hoping to have a fix out in the next few days. Will post back here with updates.
     
    Corvwyn and haraldreingruber like this.
  16. haraldreingruber

    haraldreingruber

    Joined:
    Sep 29, 2016
    Posts:
    6
    Thanks for the update!
     
  17. dannyd

    dannyd

    Unity Technologies

    Joined:
    Jun 3, 2014
    Posts:
    785
    Sorry for slow followup - had a lot of the team out of the office over the holidays. This should be fixed now on our side. Please let me know if you continue to run into this issue.
     
    altschuler likes this.
  18. chrishdev

    chrishdev

    Joined:
    Jul 18, 2017
    Posts:
    2
    Many thanks for the update @dannyd definitely looking better.

    It is still failing with:
    [Unity] ArgumentException: The Assembly System.Runtime is referenced by System.Threading..Tasks.Extensions ('Assets/System.Threading.Tasks.Extensions.dll'). But the dll is not allowed to be included or could not be found.

    I think this is because System.Threading.Tasks.Extensions is referenced by NSubstitute, and that in turn needs System.Runtime. Is there a different supported Nsubstitute which we need to use for unity, or is that just not supported now in unity with .net 4.5?

    I suspect other than that it will build now though, so thanks very much for sorting that :)
     
  19. Corvwyn

    Corvwyn

    Joined:
    Nov 15, 2013
    Posts:
    114
    Thanks for the fix and info. My game builds successfully now.
     
  20. alexjolig

    alexjolig

    Joined:
    Jul 26, 2016
    Posts:
    3
    I'm using .net3.5 and unity 2018.1.0f2 and still having this problem
     
  21. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    I'm using .net3.5 and unity 2018.1.2f1 and still having this problem on local windows dekstop build
     
  22. Corvwyn

    Corvwyn

    Joined:
    Nov 15, 2013
    Posts:
    114
    This has nothing to do with Cloud Build, so you should post this somewhere else, like the general support or scripting forum.
     
  23. VoxStudio

    VoxStudio

    Joined:
    Jan 12, 2016
    Posts:
    16
    Hello, i'm getting the same error but it is happening only for windows. It also throws error about unity purchasing that does not happens for iOS, Mac OSX and Android. Also, local builds for windows are working just fine.

    Unity Version: 2017.4.1f1
    Plataforms with problem: win32 & win64



    2918: [Unity] -----CompilerOutput:-stdout--exitcode: 255--compilationhadfailure: True--outfile: Temp/Assembly-UnityScript-firstpass.dll
    2919: [Unity] Error: System.Exception: 'UnityEngine.MonoBehaviour' was not found in any of the referenced assemblies
    2920: [Unity] -----CompilerOutput:-stdout--exitcode: 1--compilationhadfailure: True--outfile: Temp/Assembly-CSharp-firstpass.dll
    2922: [Unity] Assets/Plugins/UnityPurchasing/script/IAPButton.cs(2,19): error CS0234: The type or namespace name `Events' does not exist in the namespace `UnityEngine'. Are you missing an assembly reference?
    2923: [Unity] Assets/Plugins/UnityPurchasing/script/IAPListener.cs(2,19): error CS0234: The type or namespace name `Events' does not exist in the namespace `UnityEngine'. Are you missing an assembly reference?

     
  24. MorCompediaNet

    MorCompediaNet

    Joined:
    Jan 22, 2017
    Posts:
    21
    I'm also unable to build for Standalone:

    791: [Unity] Assets/Platform/Plugins/ZFBrowser/Scripts/Browser.cs(18,24): error CS0246: The type or namespace name `MonoBehaviour' could not be found. Are you missing an assembly reference?

    Using Unity version 2017.4.4f1


    Interestingly enough, all the errors I'm getting are spurred from scripts from the ZFBrowser plugin, which is a plugin that supports Standalone and works if I build the project locally and not through cloud build..
     
    Last edited: Oct 28, 2018
  25. VoxStudio

    VoxStudio

    Joined:
    Jan 12, 2016
    Posts:
    16
    Same error, but i'm not using this ZFBrowser, only the IAP.
     
  26. MorCompediaNet

    MorCompediaNet

    Joined:
    Jan 22, 2017
    Posts:
    21
    @dannyd Can we get an update on this issue please? Was there a regression?
     
  27. ferdinho

    ferdinho

    Joined:
    Sep 29, 2016
    Posts:
    6
    We are experiencing the same issues with multiple projects of ours since mid-October. Scripts that are compiled into their own DLLs like Assembly Definitions can’t find types in the UnityEngine namespace.
    For us this happens on Windows 64bit, scripting runtime 4.6 and Unity versions 2017.3.* and 2018.1.*. Local builds with the same settings, cloud builds for other platforms and cloud builds with Unity version 2017.4.* or 2018.2.* are working fine. Errors look like:
    "[Unity] Assets/Project/Scripts/three10/AssetBundles/AssetBundleExport/SceneControl/CameraControl.cs(7,31): error CS0246: The type or namespace name `MonoBehaviour' could not be found. Are you missing an assembly reference?"

    "[Unity] Assets/Project/Extensions/ZFBrowser/Scripts/Browser.cs(6,19): error CS0234: The type or namespace name `Assertions' does not exist in the namespace `UnityEngine'. Are you missing an assembly reference?"

    "[Unity] Assets/Plugins/CodeStage/AdvancedFPSCounter/Runtime/Scripts/AFPSCounter.cs(101,11): error CS0012: The type `UnityEngine.MonoBehaviour' is defined in an assembly that is not referenced. Consider adding a reference to assembly `UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'"

    We also created a test project dedicated to this issue with basically empty scripts in the “Assets”, “Editor” and “Plugins” folder and one script in an Assembly Definition. It is building fine with scripting runtime 3.5 and only started to fail on 2017.3.* and 2018.1.* when we switched to runtime 4.6.
     
  28. AlexNanomonx

    AlexNanomonx

    Joined:
    Jan 4, 2017
    Posts:
    41
    This is happening for us too and we're in the exact same situation. .Net 4.6, using Assembly Definitions and building 64-bit versions. I'd switch to 32-bit as a stopgap measure, but annoyingly that doesn't work either.
     
  29. AlexNanomonx

    AlexNanomonx

    Joined:
    Jan 4, 2017
    Posts:
    41
    Updating from 2017.4.3 to 2017.4.16 fixed this issue for me.