Search Unity

Bug IPCManager: Non-invocable member 'NativeHashMap<ushort, int>.Count' cannot be used like a method.

Discussion in 'Entity Component System' started by Phenotype, Nov 25, 2022.

  1. Phenotype

    Phenotype

    Joined:
    Oct 26, 2010
    Posts:
    53
    Looks like a bug in: Library\PackageCache\com.unity.transport@1.3.0\Runtime\IPCManager.cs

    Compiler Error: Non-invocable member 'NativeHashMap<ushort, int>.Count' cannot be used like a method.

    Lines 79, 88, 107

    Example: for (var i = 0; i < m_IPCChannels.Count(); ++i)
     
  2. Spy-Master

    Spy-Master

    Joined:
    Aug 4, 2022
    Posts:
    639
    That's probably from an incompatibility with whatever version of the collections package is used in the project. The collections API has been pretty unstable with a number of breaking changes. Try updating either the transport package or the collections package to the latest preview.
     
  3. Phenotype

    Phenotype

    Joined:
    Oct 26, 2010
    Posts:
    53
    All my packages are up-to-date. Unity Transport is using an older version of collections 1.2.4 while I am on 2.1.0 so that is likely where the problem is. Thanks
     
  4. Spy-Master

    Spy-Master

    Joined:
    Aug 4, 2022
    Posts:
    639
    Transport goes up to 2.0.0-pre.2.
     
  5. Phenotype

    Phenotype

    Joined:
    Oct 26, 2010
    Posts:
    53
    I don't have the option to upgrade it for some reason, probably because it's added as a dependency for netcode.
     
  6. PamuxStudios

    PamuxStudios

    Joined:
    May 11, 2014
    Posts:
    1
    A released package should never depend on a pre-release package. If it has to, then it should also be called pre-release.
     
  7. Spy-Master

    Spy-Master

    Joined:
    Aug 4, 2022
    Posts:
    639
    OK, and? What package / version are you referring to?
     
  8. qjlmeyes

    qjlmeyes

    Joined:
    Apr 19, 2023
    Posts:
    21
    Installing both entities and netcode for gameobject simultaneously can cause this issue, possibly due to a conflict between the version required by entities and netcode for gameobject
     
    GlitchedPolygons and apkdev like this.
  9. qjlmeyes

    qjlmeyes

    Joined:
    Apr 19, 2023
    Posts:
    21
    I think it's a collection issue
     

    Attached Files:

  10. JoeSwindell

    JoeSwindell

    Joined:
    May 2, 2018
    Posts:
    1
    Unity Serialization had a higher Collections dependency for me. When I uninstalled it, I was able to use a lower collections which fixed the issue.
     

    Attached Files:

  11. Endlesser

    Endlesser

    Joined:
    Nov 11, 2015
    Posts:
    89
    Add package by name 'com.unity.transport' and 'your desired version' manually fix it.
     
    peidencoding likes this.