Search Unity

Feature `out variable declaration' cannot be used error on Entities 0.0.12-preview.5

Discussion in 'Entity Component System' started by starikcetin, Jun 2, 2018.

  1. starikcetin

    starikcetin

    Joined:
    Dec 7, 2017
    Posts:
    340
    I am getting the following errors:
    Code (csharp):
    1. C:/Users/cetin/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.entities@0.0.12-preview.5/Unity.Entities/SerializeUtility.cs(28,73): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 6.0 language specification
    Same error, same file, (153,52)
    Same error, same file, (153,78)

    I already have the .NET 4.x enabled:

    Capture.PNG

    The issue is not present on the preview.4 of the same version.
     
    sean244 and vishal_merkurgame like this.
  2. starikcetin

    starikcetin

    Joined:
    Dec 7, 2017
    Posts:
    340
    After doing a Reimport All, the errors in my first post are gone, and I get these instead:

    8 times:
    Code (csharp):
    1.  (0,0): Unable to start the incremental compiler service:System.Exception: Subscribe exception: EAGAIN(11): Resource temporarily unavailable
    2. System.Threading.ThreadHelper:ThreadStart()
    4 times:
    Code (csharp):
    1. (0,0): Object reference not set to an instance of an object
    And the Package Manager windows is inaccessible due to the button missing.

    Please note that I don't have the incremental compiler package in the manifest file.
     
  3. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    1,555
    Seems like they are trying to bundle Inc compiler together in preparation for ref return in the lib...
     
  4. MaxXR

    MaxXR

    Joined:
    Jun 18, 2017
    Posts:
    67
    Am getting similar errors:

    Code (CSharp):
    1. Library/Unity/cache/packages/packages.unity.com/com.unity.entities@0.0.12-preview.5/Unity.Entities/SerializeUtility.cs(28,73): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 6.0 language specification
    2.  
    3. /Library/Unity/cache/packages/packages.unity.com/com.unity.entities@0.0.12-preview.5/Unity.Entities/SerializeUtility.cs(153,52): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 6.0 language specification
    4.  
    5. /Library/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
    Using .NET 4.x

    Preview 4 works
     
    Apiz likes this.
  5. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    1,555
    Note that while I did not get this error (But I did not use the serialize feature just yet, maybe that's related) however with preview.4 I have an another error about iterator on ComponentDataArray when using its accessor (the []) , which was fixed in preview.5.
     
  6. Afonso-Lage

    Afonso-Lage

    Joined:
    Jul 8, 2012
    Posts:
    70
    If this error still persists, try remove the ECS package, restart Unity, install ECS package again and check if it solves your problem.
     
  7. mEndlessLoop

    mEndlessLoop

    Joined:
    Jun 12, 2018
    Posts:
    7
    Wonder if someone was able to find a solution to this problem? 0.0.12-preview.6 is out and some people still get stuck using 0.0.12-preview.4 because of this......... i will love be able to try the new EntityCommandBuffer.Concurrent. :(

    I'm running Linux editor, wonder if it is platform relate, because some folks here did not get the error.

    I test it using 2018.1.3f1 and 2018.2.0b7 ... same error, removed the ecs package and reinstall it, closed and opening the editor... same, Reimport All... same, with incrementalcompiler 0.0.42-preview.1 and without (also try using 0.0.42-preview.4 just in case)... nothing , and change the variable scope in every 'out var' inside the code is not and option, cus the problem goes deeper then that. Obviously i have not idea what im doing :D so i was hoping guys with more experience like you could shed some light on this problem.
     
  8. zulfajuniadi

    zulfajuniadi

    Joined:
    Nov 18, 2017
    Posts:
    117
    Try closing unity, then delete the obj, Library and Temp folder inside the project. Might need to delete the .csproj also as those and unity should rebuild those.
     
  9. mEndlessLoop

    mEndlessLoop

    Joined:
    Jun 12, 2018
    Posts:
    7
    I tried deleting the .csproj before, this time also did as you suggested and deleted obj, library and temp folders with an old project and even tried with a brand new project... but the error still there.

    Wonder if ppl using windows/mac have the same issue, and if they are using mono or il2cpp, cus could be a classic .. your linux is missing dependencies.. kind of problem.
     
  10. mEndlessLoop

    mEndlessLoop

    Joined:
    Jun 12, 2018
    Posts:
    7
    Ok, the hacky way to bypass the error is creating a mcs.rsp with -langversion:experimental on it, then add it to the Asset folder, that allow me, entities 0.0.12-preview.6 functionality, but unity editor still not working out of the box at leas for me.
     
  11. FlorianRohm

    FlorianRohm

    Joined:
    Sep 8, 2015
    Posts:
    2
    What do you mean by still not working?
    With adding the mcs.rsp with the corresponding content you described fixed the "out variable declaration" errors and lets me play this game. TBH, I have no idea, why this is the case but I would be glad if you could elaborate what this does (or link to your resource :) ).
    The EntryPointNotFoundExceptions (see below) which are thrown ever since I try ECS (preview.4 and 6) are there anyway but do not hinder me from playing the sample.
    Arch Linux, Unity 2018.1.3f1 and 2018.2.0b7

    Code (csharp):
    1. System.AggregateException: One or more errors occurred. ---> System.TypeInitializationException: The type initializer for 'ZeroMQ.lib.zmq' threw an exception. ---> System.EntryPointNotFoundException: mono_dllmap_insert
    2.   at (wrapper managed-to-native) ZeroMQ.lib.Platform+Posix.mono_dllmap_insert(intptr,intptr,intptr,intptr,intptr)
    3.   at ZeroMQ.lib.Platform+Posix.MonoDllMapInsert (System.String libraryName, System.String libraryPath) [0x0000e] in <89499c667382432583a6a5f1fb22bd37>:0
    4.   at ZeroMQ.lib.Platform+Posix.LoadUnmanagedLibrary (System.String libraryName) [0x0022e] in <89499c667382432583a6a5f1fb22bd37>:0
    5.   at ZeroMQ.lib.zmq..cctor () [0x00588] in <89499c667382432583a6a5f1fb22bd37>:0
    6.    --- End of inner exception stack trace ---
    7.   at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_generic_class_init(intptr)
    8.   at ZeroMQ.ZContext..ctor () [0x00006] in <89499c667382432583a6a5f1fb22bd37>:0
    9.   at UnityEditor.ServiceBroker.Client+<>c__DisplayClass6_0`1[T].<Subscribe>b__0 () [0x00000] in <d12a2b5a37c340e09a4b14574b3a784b>:0
    10.   at System.Threading.Tasks.Task.InnerInvoke () [0x0000f] in <e1a80661d61443feb3dbdaac88eeb776>:0
    11.   at System.Threading.Tasks.Task.Execute () [0x00010] in <e1a80661d61443feb3dbdaac88eeb776>:0
    12.    --- End of inner exception stack trace ---
    13.   at System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) [0x00011] in <e1a80661d61443feb3dbdaac88eeb776>:0
    14.   at System.Threading.Tasks.Task.Wait (System.Int32 millisecondsTimeout, System.Threading.CancellationToken cancellationToken) [0x00043] in <e1a80661d61443feb3dbdaac88eeb776>:0
    15.   at System.Threading.Tasks.Task.Wait () [0x00000] in <e1a80661d61443feb3dbdaac88eeb776>:0
    16.   at UnityEditor.Compilation.CompilerConnection.SubscribeInternal (System.Int32 millisecondTimeout, System.Boolean retryOnTimeout, System.Int32& attempts) [0x0002c] in <d5f4d17a9e23471b97eef6dda1b7cd7c>:0
    17.   at UnityEditor.Compilation.CompilerConnection.SubscribeInternal (System.Int32 attempts) [0x00000] in <d5f4d17a9e23471b97eef6dda1b7cd7c>:0
    18.   at UnityEditor.Compilation.CompilerConnection.InitializeSingleton () [0x0002f] in <d5f4d17a9e23471b97eef6dda1b7cd7c>:0
    19.   at UnityEditor.Compilation.RoslynCompilerBootstrap..cctor () [0x0000a] in <d5f4d17a9e23471b97eef6dda1b7cd7c>:0
    20. ---> (Inner Exception #0) System.TypeInitializationException: The type initializer for 'ZeroMQ.lib.zmq' threw an exception. ---> System.EntryPointNotFoundException: mono_dllmap_insert
    21.   at (wrapper managed-to-native) ZeroMQ.lib.Platform+Posix.mono_dllmap_insert(intptr,intptr,intptr,intptr,intptr)
    22.   at ZeroMQ.lib.Platform+Posix.MonoDllMapInsert (System.String libraryName, System.String libraryPath) [0x0000e] in <89499c667382432583a6a5f1fb22bd37>:0
    23.   at ZeroMQ.lib.Platform+Posix.LoadUnmanagedLibrary (System.String libraryName) [0x0022e] in <89499c667382432583a6a5f1fb22bd37>:0
    24.   at ZeroMQ.lib.zmq..cctor () [0x00588] in <89499c667382432583a6a5f1fb22bd37>:0
    25.    --- End of inner exception stack trace ---
    26.   at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_generic_class_init(intptr)
    27.   at ZeroMQ.ZContext..ctor () [0x00006] in <89499c667382432583a6a5f1fb22bd37>:0
    28.   at UnityEditor.ServiceBroker.Client+<>c__DisplayClass6_0`1[T].<Subscribe>b__0 () [0x00000] in <d12a2b5a37c340e09a4b14574b3a784b>:0
    29.   at System.Threading.Tasks.Task.InnerInvoke () [0x0000f] in <e1a80661d61443feb3dbdaac88eeb776>:0
    30.   at System.Threading.Tasks.Task.Execute () [0x00010] in <e1a80661d61443feb3dbdaac88eeb776>:0 <---
    31.  
    32. UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes()
    33.  
     
    od3098 likes this.
  12. chmodseven

    chmodseven

    Joined:
    Jul 20, 2012
    Posts:
    120
    FYI in case it helps anyone at Unity sort this out, I had this same problem when upgrading to Entities 0.0.12-preview.8 and Incremental Compiler 0.0.42-preview.12 just now, having recently updated to Unity 2018.2. Previously working code started erroring out with the out variable issue. Rebuilding the project and the other tips here didn't work. So here's what I did:

    1. Reverted the packages back to Entities preview.4 and Incremental preview.1.
    2. These now let me compile and run the code with older versions, getting rid of any errors.
    3. Once that was working, I then reinstalled Entities preview.12 and Incremental preview.12 and this time they installed just fine and no compiler issues. Project ran fine in the editor
    4. Now the bad news - upon exiting the editor and reloading the project, the problems come back. So it's a short lived fix.

    So basically reverting to an older working state and then reinstalling the packages seems to do *something* but there's still evidently some guff going on with package issues. In the meantime, the older versions seem to remain functional.
     
  13. mEndlessLoop

    mEndlessLoop

    Joined:
    Jun 12, 2018
    Posts:
    7
    what i was trying to say is that without the mcs.rsp file inside the asset folder i will get the same error again, that why it is not working out of the box for me... only if i add the file manually.

    I do not know if this will help u, i'm running ubuntu 18.04, when i switch to 2018.2.0f1 i had the same problems, and the editor was crashing constantly, what fix it for my was adding the Gtk+ dev. Now i'm running 2018.2.0f2 with Entities 0.0.12-preview.8, Incremental Compiler 0.0.42-preview.12 and burst 0.2.4-preview.20 without problem (for now :p ) of course the mcs.rsp file still a must for me.
     
  14. JohnHudeski

    JohnHudeski

    Joined:
    Nov 18, 2017
    Posts:
    126
    Still a problem
     
  15. Dom_Laflamme

    Dom_Laflamme

    Unity Technologies

    Joined:
    Sep 25, 2013
    Posts:
    27
    This is due to using the incremental compiler version 0.0.42-preview.12
    Please update tot0. 0.0.42-preview.16

    Let me know if the issue persists

    Dom
     
    PHL1 and Antypodish like this.
  16. JohnHudeski

    JohnHudeski

    Joined:
    Nov 18, 2017
    Posts:
    126
    upload_2018-7-28_7-51-41.png

    upload_2018-7-28_7-53-26.png
     

    Attached Files:

  17. JohnHudeski

    JohnHudeski

    Joined:
    Nov 18, 2017
    Posts:
    126
    I successfully uninstalled every version of .Net from 4.5 but now I can't reinstall it
    Woot?
     
  18. starikcetin

    starikcetin

    Joined:
    Dec 7, 2017
    Posts:
    340
  19. JohnHudeski

    JohnHudeski

    Joined:
    Nov 18, 2017
    Posts:
    126
    Last edited: Jul 29, 2018
  20. starikcetin

    starikcetin

    Joined:
    Dec 7, 2017
    Posts:
    340
    With the latest incremental compiler installed, Unity hangs when I create a new script.

    Edit: After about 5 minutes I get this error in the console:

    Code (CSharp):
    1. (0,0): Unity.Compiler.Client.InvokeCompiler Exception:System.NullReferenceException: Object reference not set to an instance of an object
    2.   at UnityEditor.Compilation.RoslynIncrementalCompiler.InvokeCompiler (System.String[] unityCompilerArguments, UnityEditor.Compilation.CustomCompiler+OnCompilerMessage onMessage, UnityEditor.Compilation.CustomCompiler+OnCompilationDone onDone) [0x000e2] in <2d6d91dfaaf94b06b79250aad042efa3>:0
    3.  
     
  21. vishal_merkurgame

    vishal_merkurgame

    Joined:
    Nov 17, 2017
    Posts:
    2
    Reimport all will resolve your issue
     
  22. milaadd

    milaadd

    Joined:
    May 17, 2017
    Posts:
    11
    Capture2.JPG
    There is no way for me to use ECS system :| could you please help me how to fix this?
     
  23. JohnHudeski

    JohnHudeski

    Joined:
    Nov 18, 2017
    Posts:
    126
    I fixed this by going to the appdata folder and copying the files directly into my project
     
  24. milaadd

    milaadd

    Joined:
    May 17, 2017
    Posts:
    11
    I don't have this packages in my appdata folder at all. Is it possible to upload it some where then I could use it? :)
     
  25. JohnHudeski

    JohnHudeski

    Joined:
    Nov 18, 2017
    Posts:
    126
    I think you should clean you manifest.json to only included package manager first

    Code (csharp):
    1.  
    2. {
    3.   "registry": "https://packages.unity.com",
    4.   "dependencies": {
    5.     "com.unity.package-manager-ui": "1.9.11",
    6.   },
    7.   "testables": [
    8.     "com.unity.collections",
    9.     "com.unity.entities",
    10.     "com.unity.jobs"
    11.   ]
    12. }
    13.  
    14.  
    Also just delete every other folder from your project except the asset folder
     
  26. milaadd

    milaadd

    Joined:
    May 17, 2017
    Posts:
    11
    It still doesn't work for me it seems I have some connection problems through Unity Is there any other way to access the packages?
     
  27. T-Zee

    T-Zee

    Joined:
    Oct 23, 2017
    Posts:
    31

    i had used this manifest
    https://raw.githubusercontent.com/U...r/TwoStickShooter/Pure/Packages/manifest.json

    that was linked from a How to setup ECS page i was reading, changing it to the above version of package-manager-ui that JohnHudeski suggested fixed all my errors, thanks

    oh and i did not need to delete anything else, i just changed the version number in the manifest and all good :D
     
    JohnHudeski likes this.
  28. mneilly

    mneilly

    Joined:
    Feb 13, 2014
    Posts:
    7
  29. Jared_Brian_

    Jared_Brian_

    Joined:
    Feb 27, 2016
    Posts:
    16
    I'm not sure if this would have a major effect on other projects but at least on mine i just made a new project and then copied the project settings that were created in the new project into the project that i was getting these same type of errors on
    Code (CSharp):
    1. C:/Users/cetin/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.entities@0.0.12-preview.5/Unity.Entities/SerializeUtility.cs(28,73): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 6.0 language specification
    and then it loaded with out any errors, of course this makes it so you have to re-configure all of your project settings but for me at least that took about 2 minuets
     
  30. AAAAAAAAAE

    AAAAAAAAAE

    Joined:
    Jun 8, 2013
    Posts:
    100
    After upgrading from unity Unity 2018.2.20 release to Unity 2019.1.8 release , faced the same problem..
    changed API compatibility level .Net 4.0 and scripts got compiled.
     
  31. onianton

    onianton

    Joined:
    Mar 23, 2019
    Posts:
    1
    jakubhi, 00Sage00, GabLeRoux and 2 others like this.
  32. jakubhi

    jakubhi

    Joined:
    Sep 13, 2018
    Posts:
    1
    Monica_L22 likes this.
  33. Satsark

    Satsark

    Joined:
    Jan 11, 2018
    Posts:
    2
    How do you do this?
     
  34. AAAAAAAAAE

    AAAAAAAAAE

    Joined:
    Jun 8, 2013
    Posts:
    100
    upload_2019-9-20_14-36-40.png

    feel free testing scripting runtime version and api compatibility level
     
    Monica_L22 likes this.
  35. innovativeunderdogs

    innovativeunderdogs

    Joined:
    Nov 24, 2019
    Posts:
    1
    Thank you Anileapan05. This worked for me. You're a lifesaver.