Search Unity

Collections 1.0.0-pre.3 incompatible with Jobs 0.8.0-preview.23

Discussion in 'Entity Component System' started by ExodusOTH, Jul 21, 2021.

?

Can you reproduce this error?

  1. Yes

    100.0%
  2. No

    0 vote(s)
    0.0%
  1. ExodusOTH

    ExodusOTH

    Joined:
    Nov 30, 2017
    Posts:
    45
    Is anybody else facing the same Jobs compilation error within IJobParallelForDefer.cs when using the Collections 1.0.0-pre.3 preview package? Below is the exact error.

    Code (CSharp):
    1. Library\PackageCache\com.unity.jobs@0.8.0-preview.23\Unity.Jobs\IJobParallelForDefer.cs(77,85): error CS8377: The type 'U' must be a non-nullable value type, along with all fields at any level of nesting, in order to use it as parameter 'T' in the generic type or method 'NativeList<T>'
     
  2. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,759
    Downgrade your collections package. Compatible packages for ECS/jobs have not been released yet.
     
  3. ExodusOTH

    ExodusOTH

    Joined:
    Nov 30, 2017
    Posts:
    45
    Yah, I rolled back to 0.17.0-preview.18 and it fixed everything. I just didn't see any other posts mentioning the conflict when searching for the error and was curious if anybody else had noticed.
     
  4. desertGhost_

    desertGhost_

    Joined:
    Apr 12, 2018
    Posts:
    260
    Are you using Collections 0.17 with Entities or just jobs?

    If I recall we ran into issues when trying to use Collections 0.17 and Entities 0.17.
     
  5. ExodusOTH

    ExodusOTH

    Joined:
    Nov 30, 2017
    Posts:
    45
    @desertGhost_ I am just using Jobs.

    Unrelated, but I have come so close to using Entities on so many occasions. Every time I am held back by certain features not existing for Entities yet, along with Unity's recent "It won't be compatible for the rest of the 2021 year; Okay bye". I really hope they pull through and get it together, I desperately want to be using Entities but can't justify it with the unknowns currently.
     
  6. xofreshxo

    xofreshxo

    Joined:
    Apr 12, 2017
    Posts:
    79
    I ran into this error when updating to 2021.3 (bringing me here), and there weren't any older versions of Collections so I just updated Jobs to 0.50.0-preview.9 and it fixed the error.
     
  7. alexandre-fiset

    alexandre-fiset

    Joined:
    Mar 19, 2012
    Posts:
    715
    Entities 0.17 used to work with 2021.2 and 2021.3. Until now as there is no way to downgrade Collections back to 0.15 (and the new version doesn't work with entities .17). That is a big breaking change for a LTS version. Good thing we did not update.


    How did you manage to rollback? It seems like Unity 2021.3.1 enforces the newest version of Collections.
     
  8. ExodusOTH

    ExodusOTH

    Joined:
    Nov 30, 2017
    Posts:
    45
    @alexandre-fiset This is an old forum, however I know that Unity's been very forthright and up front that Entities is not supported in Unity 2021, but they recently released Entities 0.50.0, and they announced that while it still doesn't support Unity 2021, the very next preview release (they say 0.51.0) will support Unity 2021.

    Both when I created this forum post and still currently, I'm on 2020 LTS
     
    Anthiese likes this.
  9. Chris-Herold

    Chris-Herold

    Joined:
    Nov 14, 2011
    Posts:
    116
    Entities 0.17 + dependencies works fine in 2021.3.0f1. FYI.
     
  10. alexandre-fiset

    alexandre-fiset

    Joined:
    Mar 19, 2012
    Posts:
    715
    Yes but not in 2021.3.1.

    Unity never officially supported Entities 0.17 in the 2021 stream, but it always worked. So it came as a surprise that out of a sudden, an update broke it. I assume they are preparring to launch 0.51 fairly soon.
     
  11. alexandre-fiset

    alexandre-fiset

    Joined:
    Mar 19, 2012
    Posts:
    715
    For anyone who might have the same issue: Adding collections to the manifest without going through the package manager did not work, but this did:
    1. Add com.unity.collections from the package manager "add from git url"
    2. Let it compile
    3. Open the package manifest.json
    4. Change collections to "com.unity.collections": "0.15.0-preview.21"
    5. Let it compile
    That worked and now everything works fine in 2021.3.2. I had to fix some deprecated jobs types but that's all.
     
    Last edited: May 17, 2022
    MNNoxMortem likes this.
  12. Endlesser

    Endlesser

    Joined:
    Nov 11, 2015
    Posts:
    89
    Hi,I followed these ways above in 2021.3.5f1 but it eventually rolled back to Collections 1.2.3 no matter what, strange.

    -----------edit------------

    Figures, because too many advanced features such as Transport 1.0.0 depend on Collections 1.2.3, downgrade all dependencies first.

    But it still seems rarefied, most advanced features depends on Burst, Jobs, Collections, and Entities 0.17.0 gets malfunctioning when upgraded.

    Tricky one.
     
    Last edited: Jun 27, 2022