Search Unity

Bug Build/compiler error from Collections

Discussion in 'Entity Component System' started by gecko, Aug 29, 2022.

  1. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    We upgraded our game project from 2019.4 to 2020.3.38 and it's working fine -- except that builds fail, due to a bunch of errors about Collections, starting with this one:

    Library\PackageCache\com.unity.collections@1.4.0\Unity.Collections\AllocatorManager.cs(237,37): error CS0246: The type or namespace name 'AtomicSafetyHandle' could not be found (are you missing a using directive or an assembly reference?)

    The rest are similar, pointing to different scripts in Unity.Collections with the same issue. This is very strange since I did some test upgrades of the project and they had no trouble doing builds. Below are the packages installed. I found this thread from 2020 and tried what people suggested, but no help: https://forum.unity.com/threads/missing-references-in-the-collections-package.847027/

    Any help would be much appreciated!

    thanks
    Dave

    upload_2022-8-29_17-20-37.png
     
  2. elliotc-unity

    elliotc-unity

    Unity Technologies

    Joined:
    Nov 5, 2015
    Posts:
    230
    Have you by any chance defined ENABLE_UNITY_COLLECTIONS_CHECKS in your player settings? That would definitely have this symptom, and will not work.
     
  3. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Thanks! We have, so I removed it -- but it gets added automatically when I apply changes to the Player Settings. We searched the project and did not find that string anywhere in the code, so we don't know what is adding it....any other suggestions on how to track this down?
     
    elliotc-unity likes this.
  4. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Looks like some plugin was caching the Player Settings and adding that define back in. I edited the PlayerSettings file to remove it, and that solved the problem. Thanks for the guidance!
     
    elliotc-unity likes this.