Search Unity

Build works, but Build and Run fails

Discussion in 'Editor & General Support' started by gentlemango, Apr 14, 2021.

  1. gentlemango

    gentlemango

    Joined:
    Mar 24, 2014
    Posts:
    3
    I had an uncertain computer incident where I told my computer to shut off at the end of the evening I believe that Unity prevented the shutdown (asking to save scene changes), and I'm not really sure what happened because I didn't really think anything of it in the morning when I saw my computer screen saver was on other than that it was odd that the computer hadn't shut down.

    After that, I have two issues.

    1) The class HttpUtility is no longer recognized despite having using System.Web in the file. To be clear, I was using System.Web and HttpUtility successfully until after the incident mentioned above, after which I still have 'using System.Web;' without an error but the HttpUtility class is not recognized. I've since added a csc.rsp file to the Assets folder as per some googling which has made HttpUtility usable again but I don't understand why it went from working to not working.

    2) I can still Build successfully, but when I Build and Run I get the follow error messages:

    Cannot parse json value starting with '<!DOC' at line 1, column 1
    UnityEngine.Debug:LogError(Object)
    UnityEditorInternal.JSONParser:SimpleParse(String)
    UnityEditor.WindowsStandalone.WindowsDesktopStandalonePostProcessor:ProcessSymbolFiles(BuildPostProcessArgs)
    DesktopStandalonePostProcessor:PostProcess(BuildPostProcessArgs)
    UnityEditor.EditorApplication:Internal_CallGlobalEventHandler()

    Error building Player: Cannot parse json value starting with '<!DOC' at line 1, column 1

    Build completed with a result of 'Failed' in 13 seconds (13446 ms)
    UnityEditor.EditorApplication:Internal_CallGlobalEventHandler()

    UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
    at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002bb] in <ffcf2f9855fe46038192299154f37a45>:0
    at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <ffcf2f9855fe46038192299154f37a45>:0
    UnityEditor.EditorApplication:Internal_CallGlobalEventHandler()


    I've gathered that those second two messages are general error messages, but I included them just in case.

    The second issue it not limited to the one project. A fresh project will Build and Run repeatedly without issue, and so I have attempted to rebuild my project piece by piece to find where it breaks. It seems like after enabling Unity Analytics and Purchasing services the issue appears in fresh projects, and doesn't go away when the services are disabled. I just tested now on another project that is not using any Unity services and there is no issue with Build and Run which increases my suspicion that those services are linked to the issue.

    Of course I can get by with just Build, but the loss of convenience is a pain for testing on device/webgl (both of which I project uses), and having things shift out from under me like this is incredibly spooky.

    Any help would be greatly appreciated.