Search Unity

Error building Player because scripts had compiler errors but works in editor play mode

Discussion in 'AR/VR (XR) Discussion' started by cmkbim, Dec 28, 2018.

  1. cmkbim

    cmkbim

    Joined:
    Apr 10, 2014
    Posts:
    2
    Hi I have a UWP app and everything runs perfectly when I press the "Play" button within unity. It shows the loading of my on the fly mesh 3D game objects and visual studio builds all of the scripts without any problem. I don't have any using Unity Editor references anywhere in my scripts which I see is a common issue for the error "Error building Player because scripts had compiler errors". When I try to go build my application so I can then port it over to my HoloLens I get this error and I can't figure out which script is causing the problem.

    I am using System.IO and doing using the File class and reading from the System.Environment to get the My documents special folder. Is this maybe the culprit in that I am using something that can't be called in UWP applications?

    See attached images
    WorksInPlayMode.PNG ErrorOnBuild.PNG
     
  2. cmkbim

    cmkbim

    Joined:
    Apr 10, 2014
    Posts:
    2
    UWP doesn't support the System environment special folders, I had to download data and write it into the Application.persistentDataPath and now it builds.