Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Resolved Client android build fail to spawn ghost

Discussion in 'NetCode for ECS' started by optimise, Jun 7, 2021.

  1. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,029
    Test it with very simple sample project, the ghost fail to spawn properly and I get the error log as below at client Android mono build. Any idea why?

    2021/06/08 00:52:16.218 30912 30953 Error Unity FieldAccessException: Field `Unity.NetCode.CommandSendSystem`2:_SingletonEntityQuery_GhostCollection_1' is inaccessible from method `Unity.NetCode.CommandSendSystem`2<Unity.NetCode.Generated.UnityNetCodeNullCommandDataSerializer, Unity.NetCode.NullCommandData>:OnCreateForCompiler ()'
    2021/06/08 00:52:16.218 30912 30953 Error Unity at Unity.NetCode.Generated.UnityNetCodeNullCommandDataSendCommandSystem.OnCreateForCompiler () [0x00000] in <2d8c1f6c15ce4a379f9bc46367016946>:0
    2021/06/08 00:52:16.218 30912 30953 Error Unity at Unity.Entities.ComponentSystemBase.CreateInstance (Unity.Entities.World world, Unity.Entities.SystemState* statePtr) [0x00032] in C:\UnitySample\test\Library\PackageCache\com.unity.entities@5e423522e5\Unity.Entities\ComponentSystemBase.cs:127
    2021/06/08 00:52:16.218 30912 30953 Error Unity at Unity.Entities.World.AddSystem_OnCreate_Internal (Unity.Entities.ComponentSystemBase system) [0x00028] in C:\UnitySample\test\Library\PackageCache\com.unity.entities@5e423522e5\Unity.Entities\World.cs:281
    2021/06/08 00:52:16.218 30912 30953 Error Unity at Unity.Entities.World.GetOrCreateSystemsAndLogException (System.Collections.Generic.IEnumerable`1[
    2021/06/08 00:52:17.523 30912 30953 Error Unity FieldAccessException: Field `Unity.NetCode.CommandSendSystem`2:_SingletonEntityQuery_GhostCollection_1' is inaccessible from method `Unity.NetCode.CommandSendSystem`2<NetCube.Generated.CubeInputSerializer, CubeInput>:OnCreateForCompiler ()'
    2021/06/08 00:52:17.523 30912 30953 Error Unity at NetCube.Generated.CubeInputSendCommandSystem.OnCreateForCompiler () [0x00000] in <3aca1e4f9b3e438da975836deadf5e8e>:0
    2021/06/08 00:52:17.523 30912 30953 Error Unity at Unity.Entities.ComponentSystemBase.CreateInstance (Unity.Entities.World world, Unity.Entities.SystemState* statePtr) [0x00032] in C:\UnitySample\test\Library\PackageCache\com.unity.entities@5e423522e5\Unity.Entities\ComponentSystemBase.cs:127
    2021/06/08 00:52:17.523 30912 30953 Error Unity at Unity.Entities.World.AddSystem_OnCreate_Internal (Unity.Entities.ComponentSystemBase system) [0x00028] in C:\UnitySample\test\Library\PackageCache\com.unity.entities@5e423522e5\Unity.Entities\World.cs:281
    2021/06/08 00:52:17.523 30912 30953 Error Unity at Unity.Entities.World.GetOrCreateSystemsAndLogException (System.Collections.Generic.IEnumerable`1[T] types, System.Int32 typesCount) [0x00091] in C:\UnitySample\gamep
     
  2. NovaEiz

    NovaEiz

    Joined:
    Sep 6, 2017
    Posts:
    53
  3. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,029
    Hi @CMarastoni. Recently my real project also hit this error. It's really serious issue that need to fix asap.
     
  4. CMarastoni

    CMarastoni

    Unity Technologies

    Joined:
    Mar 18, 2020
    Posts:
    774
    It is a problem due to a combination of code stripping and some IL code generation for the GetSingleton method.
    IIRC someone mentioned also a compatibility problem with .Net 4.x. Are you using it or do you use .NetStandard 2.0?
    I never hit that one specifically in any of the project and samples we have.
    A possible work around for that may be to change the CommandSendSystem generic class and instead of using the RequireSingletonForUpdate() trying to use the RequireForUpdate and pass a query explicility.
     
    optimise likes this.
  5. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,029
    Is that related to burst package bug? I see inside burst changelog I see there's same bug that was fixed before.

    Ya. My project is using .NetStandard 2.0. Still not working.

    Can u show me how to it? Not really understand how it actually works.
     
  6. CMarastoni

    CMarastoni

    Unity Technologies

    Joined:
    Mar 18, 2020
    Posts:
    774
    I don't think it is a burst problem. However, it is possible that some combination of packages may cause it.
     
  7. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,029
    I dun understand is why only mono build has issue meanwhile il2cpp build is working properly?
     
    Last edited: Jun 16, 2021
  8. NovaEiz

    NovaEiz

    Joined:
    Sep 6, 2017
    Posts:
    53
    My project when building IL2CPP Android gives an error.
    Only Mono is built, which contains the error specified in the first post.(