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. Dismiss Notice

Build Error Windows 10 - Could not start compilationArgumentNullException

Discussion in 'Windows' started by twixthehero, Aug 7, 2016.

  1. twixthehero

    twixthehero

    Joined:
    Jan 17, 2013
    Posts:
    6
    When I switch back to the Unity editor from Visual Studio after making a change, this error shows up in the console:

    Until I restart the Unity Editor, I am unable to compile and build. Upon restart, building and compiling works correctly with no errors.

    It seems similar to http://forum.unity3d.com/threads/builderror-windows-10-system-io-pathcombine.364717/
    except that I am running a 64-bit system and the Parameter name is 'encoding'.

    Full editor log: http://pastebin.com/raw/3Y8Mdjwt

    Any ideas?
     
  2. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,624
    Perhaps something is locking files? Try closing VS and see if Unity recovers.
    Can you try reproducing this on a different machine?
     
  3. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,647
  4. twixthehero

    twixthehero

    Joined:
    Jan 17, 2013
    Posts:
    6
    I tried closing VS and Unity was still unable to compile. I will try this on my laptop and see if I can reproduce it.

    My system is set to use English. But I do have two English keyboard layouts and Japanese also installed.

    I tried logging Console.Out.Encoding when my game starts, and it printed "System.Text.UTF8Encoding"
     
  5. twixthehero

    twixthehero

    Joined:
    Jan 17, 2013
    Posts:
    6
    I am able to reproduce the same issue on my laptop (Unity 64-bit, English locale, multiple keyboard layouts and Japanese).

    It also seems to only happen after the editor has been run once.
     
  6. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,647
    Can you submit a bug regarding this with Editor.log attached?
     
  7. twixthehero

    twixthehero

    Joined:
    Jan 17, 2013
    Posts:
    6
  8. twixthehero

    twixthehero

    Joined:
    Jan 17, 2013
    Posts:
    6
    I figured out the issue. It was due to the default output (Console.Out) being set to another StreamWriter. When Unity finishes running the game in the editor, that StreamWriter is disposed, and the reference to Console.Out is now null. Then Unity tries to build and encounters that null reference exception.

    How do I close the bug report?
     
  9. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,647
    I'll close it, glad you have it resolved.

    Cheers