Search Unity

Bug ArgumentException: Unknown Type:`Unity.Entities.LinkedEntityGroup`

Discussion in 'Entity Component System' started by Karearea, Mar 29, 2022.

  1. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    386
    Hi,

    I recently updated my project to Entities 0.50, and after following the upgrade guide had it working nicely, without any errors or warnings. I've since updated the editor to 2020.3.32f1 and that too was fine. I'm only using the packages that Entities gathers as dependencies, com.unity.platforms, Hybrid Renderer and Havok Physics. All good so far..

    Last night I updated my MacBook Pro OS, to MacOS 12.3. Since then I can still build to Mac Standalone ok, but when I try to run the standalone executable I get an error in the log which suggests the world isn't being created properly.

    Code (CSharp):
    1. ArgumentException: Unknown Type:`Unity.Entities.LinkedEntityGroup` All ComponentType must be known at compile time. For generic components, each concrete type must be registered with [RegisterGenericComponentType].
    2.   at Unity.Entities.TypeManager.ManagedException (System.Type type) [0x00000] in <00000000000000000000000000000000>:0
    3.   at Unity.Entities.TypeManager.GetTypeIndex[T] () [0x00000] in <00000000000000000000000000000000>:0
    4.   at Unity.Entities.EntityComponentStore.Create (Unity.Entities.EntityComponentStore* entities, System.UInt64 startChunkSequenceNumber, System.Int32 newCapacity) [0x00000] in <00000000000000000000000000000000>:0
    5.   at Unity.Entities.EntityDataAccess.Initialize (Unity.Entities.EntityDataAccess* self, Unity.Entities.World world) [0x00000] in <00000000000000000000000000000000>:0
    6.   at Unity.Entities.WorldUnmanaged.Create (Unity.Entities.World world, Unity.Entities.WorldFlags flags, Unity.Collections.AllocatorManager+AllocatorHandle backingAllocatorHandle) [0x00000] in <00000000000000000000000000000000>:0
    7.   at Unity.Entities.World.Init (Unity.Entities.WorldFlags flags, Unity.Collections.AllocatorManager+AllocatorHandle backingAllocatorHandle) [0x00000] in <00000000000000000000000000000000>:0
    8.   at Unity.Entities.World..ctor (System.String name, Unity.Entities.WorldFlags flags) [0x00000] in <00000000000000000000000000000000>:0
    9.   at Unity.Entities.DefaultWorldInitialization.Initialize (System.String defaultWorldName, System.Boolean editorWorld) [0x00000] in <00000000000000000000000000000000>:0
    10.   at Unity.Entities.AutomaticWorldBootstrap.Initialize () [0x00000] in <00000000000000000000000000000000>:0
    I've deleted the entire project and re downloaded from source (from before the error), found the package manager cache and cleared it etc. and the error in the standalone build persists. Wondering if this is actually a problem with MacOS or if there is something going on with my Unity install. Or of course there's a problem in my code that only shows up now?
     
    Anthiese likes this.
  2. Anthiese

    Anthiese

    Joined:
    Oct 13, 2013
    Posts:
    73
    You're not the only one. I've had this happen to me with automatic bootstrap, but strangely it only happened when using Release optimization on IL2CPP. Debug IL2CPP and Mono worked fine. I disabled the automatic bootstrap so this error doesn't happen, but then something else comes crashing down later (full native crash from segfault).
    I'm also on 2020.3.32f1 and macOS 12.3.
    a bit more info here
     
    Karearea likes this.
  3. elliotc-unity

    elliotc-unity

    Unity Technologies

    Joined:
    Nov 5, 2015
    Posts:
    230
    This is overwhelmingly the error you get when TypeManager.Initialize threw an exception. So if you scroll up in the log, you should see the actual problem. Most likely something got stripped that was important.
     
  4. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    386
    Hi, thanks for responding. It's literally the only error in the log, ie:

    Code (CSharp):
    1. New input system (experimental) initialized
    2. Initialize engine version: 2020.3.32f1 (12f8b0834f07)
    3. [Subsystems] Discovering subsystems at path /Users/nh/Documents/FSProto/Runtime/FSProto.app/Contents/Resources/Data/UnitySubsystems
    4. GfxDevice: creating device client; threaded=1
    5. 2022-03-30 08:59:57.415 Anabatica[5665:52999] (null) preferred device: Apple M1 Max (high power)
    6. 2022-03-30 08:59:57.415 Anabatica[5665:52999] Metal devices available: 1
    7. 2022-03-30 08:59:57.415 Anabatica[5665:52999] 0: Apple M1 Max (high power)
    8. 2022-03-30 08:59:57.415 Anabatica[5665:52999] Using device Apple M1 Max (high power)
    9. Initializing Metal device caps: Apple M1 Max
    10. UnloadTime: 0.575083 ms
    11. ArgumentException: Unknown Type:`Unity.Entities.LinkedEntityGroup` All ComponentType must be known at compile time. For generic components, each concrete type must be registered with [RegisterGenericComponentType].
    12.   at Unity.Entities.TypeManager.ManagedException (System.Type type) [0x00000] in <00000000000000000000000000000000>:0
    13.   at Unity.Entities.TypeManager.GetTypeIndex[T] () [0x00000] in <00000000000000000000000000000000>:0
    14.   at Unity.Entities.EntityComponentStore.Create (Unity.Entities.EntityComponentStore* entities, System.UInt64 startChunkSequenceNumber, System.Int32 newCapacity) [0x00000] in <00000000000000000000000000000000>:0
    15.   at Unity.Entities.EntityDataAccess.Initialize (Unity.Entities.EntityDataAccess* self, Unity.Entities.World world) [0x00000] in <00000000000000000000000000000000>:0
    16.   at Unity.Entities.WorldUnmanaged.Create (Unity.Entities.World world, Unity.Entities.WorldFlags flags, Unity.Collections.AllocatorManager+AllocatorHandle backingAllocatorHandle) [0x00000] in <00000000000000000000000000000000>:0
    17.   at Unity.Entities.World.Init (Unity.Entities.WorldFlags flags, Unity.Collections.AllocatorManager+AllocatorHandle backingAllocatorHandle) [0x00000] in <00000000000000000000000000000000>:0
    18.   at Unity.Entities.World..ctor (System.String name, Unity.Entities.WorldFlags flags) [0x00000] in <00000000000000000000000000000000>:0
    19.   at Unity.Entities.DefaultWorldInitialization.Initialize (System.String defaultWorldName, System.Boolean editorWorld) [0x00000] in <00000000000000000000000000000000>:0
    20.   at Unity.Entities.AutomaticWorldBootstrap.Initialize () [0x00000] in <00000000000000000000000000000000>:0
    I tried building to IL2CPP Debug configuration as @cyriaca suggested, and it ran correctly, albeit very very slowly. I've also tried adding a link.xml, but I'm not sure I've got the syntax right?

    Code (CSharp):
    1. <linker>
    2.  
    3.     <assembly fullname="Unity.Entities"/>
    4.     <type fullname="Unity.Entities.*" preserve="all"/>
    5.  
    6. </linker>
     
  5. elliotc-unity

    elliotc-unity

    Unity Technologies

    Joined:
    Nov 5, 2015
    Posts:
    230
    This is really odd. We can't really see how this could happen. How big is your project? Could we see a repro?
     
  6. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    386
    Hi I've sent you a DM with a Dropbox link to a stripped-out project. Thanks!
     
  7. cd001u

    cd001u

    Joined:
    Mar 14, 2022
    Posts:
    2
    I've encontered this problem as well, any feedbacks?
     
    Neiist likes this.
  8. cd001u

    cd001u

    Joined:
    Mar 14, 2022
    Posts:
    2
    I've encounter this problem as well, and I built my test project which contains com.unity.entities-0.11.2-preview1 pacakge only under Unity 2019.4.36 and Xcode 13.3 (with iOS SDK 15),these errors appears once start up. It seems irrelevant to code striping cuz i found the generated code of LinkedEntityGroup. I'm looking forward to any progress of this problem, thx.
     
  9. Smarte

    Smarte

    Joined:
    Jan 27, 2016
    Posts:
    1
    For anyone who finds this issue, After extensive testing we found that it was the Xcode version no longer correctly building, reverting to Xcode version 13.0 resolves this problem.
     
    Karearea and elliotc-unity like this.
  10. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    386
    Thanks so much, this fixed it on my side too.