Search Unity

[solved] (Entities prev 4) unity.entities@0.0.12-preview.x error

Discussion in 'Entity Component System' started by Antypodish, Jul 31, 2018.

  1. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,770
    I have opened new project. Changed .Net in player to 4.0. Restarted.
    Installed Entities. And get dropped with few errors.

    When I did it at very first time, it worked no problem. But now, every time, for different previous versions.

    C:/Users/.../AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.entities@0.0.12-preview.5/Unity.Entities/SerializeUtility.cs(153,78): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 6.0 language specification

    How to fix it?
     
  2. recursive

    recursive

    Joined:
    Jul 12, 2012
    Posts:
    669
    Hmm, looks like you don't have the incremental compiler. I thought the ECS packages now include that as a dependency package, but maybe you have a version that didn't have that or something happened to the package download?

    You should look at the incremental compiler thread for instructions. Some people have issues with getting it setup, some of us have it working just fine.

    If you use Rider as your IDE you may need to manually set your C# version to 7.2.
     
  3. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,770
    Ok thx,
    Followed suggested steps, then had different error
    Copying assembly from directory Temp to Library/ScriptAssemblies failed

    I see recent relevant issues are discussed on the thread
    Unity Incremental C# Compiler
    https://forum.unity.com/threads/unity-incremental-c-compiler.523993/page-6#post-3577534
    (page 6)

    Strange thing is, first time I installed Entities on new fresh project, I had no need to look into Incremental Compiler. Nvm.
     
  4. recursive

    recursive

    Joined:
    Jul 12, 2012
    Posts:
    669
    Those copying issues seem to go away for me if close unity, then delete the Temp, obj (if it exists), and Library folders and open it back up. Then again I have my project setup for source control and don't have many assets yet (my nights-and-weekends ECS project is mostly a code playground at this point).
     
  5. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,770
    Thx for suggestions.

    Some steps I have tried are:
    I had clean project, with only Sample Scene.
    Tried follow instructions from Incremental C# Compiler.
    Tried delete ScriptAssemblies folder, Temp and even Library, folders.
    Change manifest.json file.
    Each time restarting Unity.
    Seams copy issue stays on.
    And is some cases Package Manger form Window menu options is gone.
    I may give a go few more times.

    Or in meantime, I will work with my initial project, when once importing entities happen to work out of the box.
     
    recursive likes this.
  6. recursive

    recursive

    Joined:
    Jul 12, 2012
    Posts:
    669
    Coincidentally, what platform are you on? I've gotten everything to work on my 2015 Macbook Pro (2018.2 release) and my windows PC (older 2018.2 betas, need to update). Could OS config be a factor?
     
  7. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,770
    I got win 7 x64 ulti.
    I don't know, maybe.
    Even doubtful, I think there maybe something saved somewhere outside the project.
    like in case of mentioned error, the path is in user OS folder.
    C:/Users/.../AppData/Local/Unity/cache

    Edit:
    In contrast: loaded ECS projects examples seams work fine.
     
    Last edited: Jul 31, 2018
  8. recursive

    recursive

    Joined:
    Jul 12, 2012
    Posts:
    669
    Huh, the only thing I can think of configuration-wise might be Win7, and not having some parts of the VS / Mono installed. The fact that it's just a new project makes it seem like a mis-configured manifest, as far as I can tell.
     
  9. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,770
    I have recorded simple example, of the issue.
    So I use examples project from github.
    In this case I use ECS Boid, with fish swarm. But can be anything from that examples.
    Then create some folder. I.e. ECS.
    Then moving Scene folder there.
    And moving scripts folder there.
    Once I do move scripts and refresh, bunch of errors occur.
    Restarting Unity, or moving scrips nor scene folders back, do not fix issue.
    Only way to resolve, is to delete whole project and copy original, from zip file.

    2.5 min vid with issue

     
  10. mEndlessLoop

    mEndlessLoop

    Joined:
    Jun 12, 2018
    Posts:
    7
    1. Open New Project
    2. Changed to NET 4.x
    3. Add entities@0.0.12-preview.8 using the package manager
    3. Exit editor
    4. Created a Mcs.rsp file with.... -langversion:experimental .... on it
    5. Copy Mcs.rsp file to Asset folder
    6. Enter editor again, ('out var' error should be gone)
    7. Install incremental compiler preview if u still need it (as far as i know ECS package already have the incremental compiler.. but i could be wrong).
     
    Antypodish likes this.
  11. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,770
    Many Thx,
    I will definitely try, with nearest occasion, as I had again relevant issue last night, with other samples scripts.
     
  12. GregoryFenn

    GregoryFenn

    Joined:
    Feb 13, 2018
    Posts:
    43
    Can you explain step 4? What is an rsp file for, and what does it look like? Should I literally make a textfile named Mcs.rsp with just the line "-langversion:experimental"?
     
  13. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,759
  14. print_helloworld

    print_helloworld

    Joined:
    Nov 14, 2016
    Posts:
    231
  15. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,759
    Incremental compiler gives you c# 7 - which is why I believe the entity package now depends on it
     
  16. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
    Can you please report a bug for this? It looks like Unity is having trouble moving files around for some reason, but I can't say why from the video. The video would be good to include in the bug report, though, since it shows clearly what happens on your machine.

    This is correct. Unfortunately this leads to confusing errors when we aren't able to compile the incremental compiler support for whatever reason.
     
    Antypodish likes this.
  17. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,770
    Many thank for response.

    I was trying reproduce this issue few times, but couldn't, so I wasn't posting back.
    Maybe earlier in my case, updating to certain Unity version did affect it. Not sure.

    I just recently updated to latest preview of Entities 0.0.12 prev 11, from Entites preview 4 (so big jump). Also at one go installed Incremental Compiler (0.0.42 prev 19) and Burst (0.2.4 prev 25).
    Now the issue seams to be gone.
    Just need to remember, to restart Unity, after loading packages.

    And yes, appears that Entities may require Incremental Compiler now.
     
    Last edited: Sep 4, 2018