Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Unity 2017.1 - Build to PC results in errors

Discussion in 'Editor & General Support' started by Magnumstar, Aug 7, 2017.

  1. Magnumstar

    Magnumstar

    Joined:
    Oct 3, 2015
    Posts:
    304
    I just downloaded 2017.1, have my project imported and it plays fine no errors. When I go to File>Build and try to build for PC, i hit build and nothing happens, then i proceed to play my scene again and it behaves unplayable now. Also now all the scripts in my hierarchy have a yellow exclamation point that say "The associated script can not be loaded. Please fix any compile errors and assign a valid script". There are no compile errors. Then i go into VS 2017 and there's missing references to all Unity libraries. I am unable to fix.
     
  2. Magnumstar

    Magnumstar

    Joined:
    Oct 3, 2015
    Posts:
    304
    Well i tried with Unity 5.6 and it's the same. I recently had a team member check in some changes and everything got wonky... The game and scene plays fine until I try to go to build... then even if i restart unity the scripts all remain missing with yellow exclamation points. Does anybody know why this is?
     
  3. Magnumstar

    Magnumstar

    Joined:
    Oct 3, 2015
    Posts:
    304
    So here's unity after I try to build for any platform using File>Build. The build selection does not load the normal "compiling" progress bar the program flickers and then loses control back to unity.




    Before I build I can play, debug and breakpoint in V.S... after wards I cannot. I have to go to Assets>Reimport All Assets to have a playable scene again.


    After i hit build, the breakpoints in visual studio debugger show exclamation points as well, that say when hovered over: "The breakpoint will not currently be hit. Unable to find a corresponding location"

    One thing i noted is if i went to build player settings and changed api to .net 2.0 instead of .net 2.0 subset, the scripts are magically found again. Until i try to build to platform...



    Heres the end of the editor.log file:
    Code (csharp):
    1.  
    2. *** Cancelled 'Build.Player.WindowsStandaloneSupport' in 2 seconds (2121 ms)
    3.  
    4. UnityEditor.BuildPlayerWindow+BuildMethodException: Build failed with errors.
    5.   at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x001b9] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:162
    6.   at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x00050] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:83
    7. UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
    8. UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    9. UnityEngine.Logger:Log(LogType, Object)
    10. UnityEngine.Debug:LogError(Object)
    11. UnityEditor.BuildPlayerWindow:CallBuildMethods(Boolean, BuildOptions) (at C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:88)
    12. UnityEditor.BuildPlayerWindow:GUIBuildButtons(IBuildWindowExtension, Boolean, Boolean, Boolean, BuildPlatform) (at C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindow.cs:1026)
    13. UnityEditor.BuildPlayerWindow:ShowBuildTargetSettings() (at C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindow.cs:953)
    14. UnityEditor.BuildPlayerWindow:OnGUI() (at C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindow.cs:593)
    15. System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception&)
    16. System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    17. System.Reflection.MethodBase:Invoke(Object, Object[]) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
    18. UnityEditor.HostView:Invoke(String, Object) (at C:\buildslave\unity\build\Editor\Mono\HostView.cs:272)
    19. UnityEditor.HostView:Invoke(String) (at C:\buildslave\unity\build\Editor\Mono\HostView.cs:265)
    20. UnityEditor.HostView:OnGUI() (at C:\buildslave\unity\build\Editor\Mono\HostView.cs:94)
    21.  
    22. (Filename: /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs Line: 222)
    23.  
    24.  
     
    Last edited: Aug 12, 2017
  4. Magnumstar

    Magnumstar

    Joined:
    Oct 3, 2015
    Posts:
    304
    :rolleyes:

    There was a build error, that apparently makes all the scripts in the scene say associated script is missing along with visual studio errors... strange, but fixed script and done. Do I feel green...