Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

HybridComponent breaks in build

Discussion in 'Entity Component System' started by Srokaaa, Apr 30, 2020.

  1. Srokaaa

    Srokaaa

    Joined:
    Sep 18, 2018
    Posts:
    169
    Recent update of Entities package (0.9) broke iOS builds when I have hybrid components with VFXGraph. In Editor everything works fine but when I build to run on the device I get the following error on scene load:


    Code (CSharp):
    1. MissingPropertyBagException: No PropertyBag was found for Type=[UnityEngine.VFX.VisualEffect]. Please make sure all types are declared ahead of time using [GeneratePropertyBagAttribute], [GeneratePropertyBagsForTypeAttribute] or [GeneratePropertyBagsForTypesQualifiedWithAttribute]
    2.   at Unity.Properties.PropertyContainer.Visit[TContainer] (TContainer& container, Unity.Properties.Internal.IVisitor visitor, Unity.Properties.VisitParameters parameters) [0x00000] in <00000000000000000000000000000000>:0
    3.   at Unity.Properties.PropertyContainer.Visit (System.Object container, Unity.Properties.PropertyVisitor visitor, Unity.Properties.VisitParameters parameters) [0x00000] in <00000000000000000000000000000000>:0
    4.   at Unity.Entities.EntityRemapUtility.PatchEntityForPrefabInBoxedType (System.Object container, Unity.Entities.Entity* remapSrc, Unity.Entities.Entity* remapDst, System.Int32 remapInfoCount) [0x00000] in <00000000000000000000000000000000>:0
    5.   at Unity.Entities.ManagedComponentStore.PatchEntitiesForPrefab (System.Int32* managedComponents, System.Int32 numManagedComponents, System.Int32 allocatedCount, System.Int32 remappingCount, Unity.Entities.Entity* remapSrc, Unity.Entities.Entity* remapDst) [0x00000] in <00000000000000000000000000000000>:0
    6.   at Unity.Entities.ManagedComponentStore.Playback (Unity.Entities.ManagedDeferredCommands& managedDeferredCommands) [0x00000] in <00000000000000000000000000000000>:0
    7.   at Unity.Entities.EntityDataAccess.Initialize (Unity.Entities.EntityDataAccess* self, Unity.Entities.World world) [0x00000] in <00000000000000000000000000000000>:0
    8.   at Unity.Entities.EntityManager.op_Implicit (System.Nullable`1[T] shim) [0x00000] in <00000000000000000000000000000000>:0
    9.   at Unity.Rendering.AddWorldAndChunkRenderBounds.OnUpdate () [0x00000] in <00000000000000000000000000000000>:0
    10.   at Unity.Entities.ComponentSystem.Update () [0x00000] in <00000000000000000000000000000000>:0
    11.   at Unity.Entities.ComponentSystemGroup.UpdateAllSystems () [0x00000] in <00000000000000000000000000000000>:0
    12.   at Unity.Entities.ComponentSystemGroup.OnUpdate () [0x00000] in <00000000000000000000000000000000>:0
    13.   at Unity.Entities.ComponentSystem.Update () [0x00000] in <00000000000000000000000000000000>:0
    14.   at Unity.Entities.ComponentSystemGroup.UpdateAllSystems () [0x00000] in <00000000000000000000000000000000>:0
    15.   at Unity.Entities.ComponentSystemGroup.OnUpdate () [0x00000] in <00000000000000000000000000000000>:0
    16.   at Unity.Entities.ComponentSystem.Update () [0x00000] in <00000000000000000000000000000000>:0
    17.   at Unity.Entities.ScriptBehaviourUpdateOrder+DummyDelegateWrapper.TriggerUpdate () [0x00000] in <00000000000000000000000000000000>:0
    18.   at UnityEngine.LowLevel.PlayerLoopSystem+UpdateFunction.Invoke () [0x00000] in <00000000000000000000000000000000>:0
    19. UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
    20. UnityEngine.DebugLogHandler:LogException(Exception, Object)
    21. UnityEngine.Logger:LogException(Exception, Object)
    22. UnityEngine.Debug:LogException(Exception)
    23. Unity.Debug:LogException(Exception)
    24. Unity.Entities.ComponentSystemGroup:UpdateAllSystems()
    25. Unity.Entities.ComponentSystemGroup:OnUpdate()
    26. Unity.Entities.ComponentSystem:Update()
    27. Unity.Entities.ComponentSystemGroup:UpdateAllSystems()
    28. Unity.Entities.ComponentSystemGroup:OnUpdate()
    29. Unity.Entities.ComponentSystem:Update()
    30. Unity.Entities.DummyDelegateWrapper:TriggerUpdate()
    31. UnityEngine.LowLevel.UpdateFunction:Invoke()
    32.  

    and then this error on every frame:


    Code (CSharp):
    1. (Filename: currently not available on il2cpp Line: -1)
    2.  
    3. IndexOutOfRangeException: Index was outside the bounds of the array.
    4.   at Unity.Entities.ManagedComponentStore.PatchEntitiesForPrefab (System.Int32* managedComponents, System.Int32 numManagedComponents, System.Int32 allocatedCount, System.Int32 remappingCount, Unity.Entities.Entity* remapSrc, Unity.Entities.Entity* remapDst) [0x00000] in <00000000000000000000000000000000>:0
    5.   at Unity.Entities.ManagedComponentStore.Playback (Unity.Entities.ManagedDeferredCommands& managedDeferredCommands) [0x00000] in <00000000000000000000000000000000>:0
    6.   at Unity.Entities.EntityDataAccess.Initialize (Unity.Entities.EntityDataAccess* self, Unity.Entities.World world) [0x00000] in <00000000000000000000000000000000>:0
    7.   at Unity.Entities.EntityDataAccess.Initialize (Unity.Entities.EntityDataAccess* self, Unity.Entities.World world) [0x00000] in <00000000000000000000000000000000>:0
    8.   at Unity.Entities.EntityManager.op_Implicit (System.Nullable`1[T] shim) [0x00000] in <00000000000000000000000000000000>:0
    9.   at Unity.Entities.EntityManager.op_Implicit (System.Nullable`1[T] shim) [0x00000] in <00000000000000000000000000000000>:0
    10.   at Arc.Inputs.ChangeInputMappingCategorySystem.<OnUpdate>b__0_0 (Unity.Entities.Entity entity, Arc.Inputs.Components.InputMappingCategorySetter& inputMappingCategorySetter) [0x00000] in <00000000000000000000000000000000>:0
    11.   at Arc.Inputs.SettingsInputSystem.<>GetEntityQuery_ForOnUpdate_LambdaJob0_From (Unity.Entities.ComponentSystemBase componentSystem) [0x00000] in <00000000000000000000000000000000>:0
    12.   at Arc.Inputs.ChangeInputMappingCategorySystem+<>c__DisplayClass_OnUpdate_LambdaJob0.PerformLambda (System.Void* jobStructPtr, System.Void* runtimesPtr, Unity.Entities.Entity entity) [0x00000] in <00000000000000000000000000000000>:0
    13.   at Unity.Entities.CodeGeneratedJobForEach.StructuralChangeEntityProvider+PerformLambdaDelegate.Invoke (System.Void* jobStruct, System.Void* runtimes, Unity.Entities.Entity entity) [0x00000] in <00000000000000000000000000000000>:0
    14.   at Unity.Entities.StructuralChange.Initialize () [0x00000] in <00000000000000000000000000000000>:0
    15.   at Arc.Inputs.ChangeInputMappingCategorySystem.OnUpdate () [0x00000] in <00000000000000000000000000000000>:0
    16.   at Arc.Inputs.ChangeInputMappingCategorySystem.OnUpdate () [0x00000] in <00000000000000000000000000000000>:0
    17.   at Unity.Entities.SystemBase.Update () [0x00000] in <00000000000000000000000000000000>:0
    18.   at Unity.Entities.ComponentSystemGroup.UpdateAllSystems () [0x00000] in <00000000000000000000000000000000>:0
    19.   at Unity.Entities.ComponentSystemGroup.OnUpdate () [0x00000] in <00000000000000000000000000000000>:0
    20.   at Unity.Entities.ComponentSystem.Update () [0x00000] in <00000000000000000000000000000000>:0
    21.   at Unity.Entities.ComponentSystemGroup.UpdateAllSystems () [0x00000] in <00000000000000000000000000000000>:0
    22.   at Unity.Entities.ComponentSystemGroup.OnUpdate () [0x00000] in <00000000000000000000000000000000>:0
    23.   at Unity.Entities.ComponentSystem.Update () [0x00000] in <00000000000000000000000000000000>:0
    24.   at Unity.Entities.ScriptBehaviourUpdateOrder+DummyDelegateWrapper.TriggerUpdate () [0x00000] in <00000000000000000000000000000000>:0
    25.   at UnityEngine.LowLevel.PlayerLoopSystem+UpdateFunction.Invoke () [0x00000] in <00000000000000000000000000000000>:0
    26. UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
    27. UnityEngine.DebugLogHandler:LogException(Exception, Object)
    28. UnityEngine.Logger:LogException(Exception, Object)
    29. UnityEngine.Debug:LogException(Exception)
    30. Unity.Debug:LogException(Exception)
    31. Unity.Entities.ComponentSystemGroup:UpdateAllSystems()
    32. Unity.Entities.ComponentSystemGroup:OnUpdate()
    33. Unity.Entities.ComponentSystem:Update()
    34. Unity.Entities.ComponentSystemGroup:UpdateAllSystems()
    35. Unity.Entities.ComponentSystemGroup:OnUpdate()
    36. Unity.Entities.ComponentSystem:Update()
    37. Unity.Entities.DummyDelegateWrapper:TriggerUpdate()
    38. UnityEngine.LowLevel.UpdateFunction:Invoke()
    It was working fine with Entiities 0.6 when I was adding hybrid components manually in this way:

    Code (CSharp):
    1.     public class AttachVisualEffectAuthoring : MonoBehaviour, IConvertGameObjectToEntity
    2.     {
    3.         public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
    4.         {
    5.             conversionSystem.AddHybridComponent(GetComponent<VisualEffect>());
    6.         }
    7.     }
    8.  
    EDIT: I also checked Entities 0.10.0 and the same thing happens. Will update when I check non-ios builds
     
    nicolasgramlich likes this.
  2. Srokaaa

    Srokaaa

    Joined:
    Sep 18, 2018
    Posts:
    169
  3. nicolasgramlich

    nicolasgramlich

    Joined:
    Sep 21, 2017
    Posts:
    231
    Same issue for
    TrailRenderer
    with version
    0.10.0-preview.6
    on Android builds (it's fine in the Editor).

    Code (CSharp):
    1. MissingPropertyBagException: No PropertyBag was found for Type=[UnityEngine.TrailRenderer].
    Sighs, I've attempted every single Entities version post 0.6 and ended up with show stopping issues :(:confused:

    Packages:
    {
    "dependencies": {
    "com.unity.2d.sprite": "1.0.0",
    "com.unity.analytics": "3.4.0",
    "com.unity.burst": "1.3.0-preview.11",
    "com.unity.collab-proxy": "1.2.16",
    "com.unity.device-simulator": "2.2.2-preview",
    "com.unity.dots.editor": "0.6.0-preview",
    "com.unity.entities": "0.10.0-preview.6",
    "com.unity.ide.rider": "2.0.2",
    "com.unity.ide.vscode": "1.2.0",
    "com.unity.inputsystem": "1.0.0",
    "com.unity.jobs": "0.2.9-preview.15",
    "com.unity.performance.profile-analyzer": "0.6.0-preview.1",
    "com.unity.physics": "0.3.2-preview",
    "com.unity.platforms.android": "0.3.0-preview.7",
    "com.unity.polybrush": "1.0.1",
    "com.unity.probuilder": "4.2.3",
    "com.unity.progrids": "3.0.3-preview.6",
    "com.unity.quicksearch": "1.5.3",
    "com.unity.render-pipelines.universal": "7.3.1",
    "com.unity.rendering.hybrid": "0.5.0-preview.6",
    "com.unity.test-framework": "1.1.14",
    "com.unity.test-framework.performance": "2.0.9-preview",
    "com.unity.textmeshpro": "2.0.1",
    "com.unity.timeline": "1.3.2",
    "com.unity.ugui": "1.0.0",
    "com.unity.modules.ai": "1.0.0",
    "com.unity.modules.androidjni": "1.0.0",
    "com.unity.modules.animation": "1.0.0",
    "com.unity.modules.assetbundle": "1.0.0",
    "com.unity.modules.audio": "1.0.0",
    "com.unity.modules.cloth": "1.0.0",
    "com.unity.modules.director": "1.0.0",
    "com.unity.modules.imageconversion": "1.0.0",
    "com.unity.modules.imgui": "1.0.0",
    "com.unity.modules.jsonserialize": "1.0.0",
    "com.unity.modules.particlesystem": "1.0.0",
    "com.unity.modules.physics": "1.0.0",
    "com.unity.modules.physics2d": "1.0.0",
    "com.unity.modules.screencapture": "1.0.0",
    "com.unity.modules.terrain": "1.0.0",
    "com.unity.modules.terrainphysics": "1.0.0",
    "com.unity.modules.tilemap": "1.0.0",
    "com.unity.modules.ui": "1.0.0",
    "com.unity.modules.uielements": "1.0.0",
    "com.unity.modules.umbra": "1.0.0",
    "com.unity.modules.unityanalytics": "1.0.0",
    "com.unity.modules.unitywebrequest": "1.0.0",
    "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
    "com.unity.modules.unitywebrequestaudio": "1.0.0",
    "com.unity.modules.unitywebrequesttexture": "1.0.0",
    "com.unity.modules.unitywebrequestwww": "1.0.0",
    "com.unity.modules.vehicles": "1.0.0",
    "com.unity.modules.video": "1.0.0",
    "com.unity.modules.vr": "1.0.0",
    "com.unity.modules.wind": "1.0.0",
    "com.unity.modules.xr": "1.0.0"
    }
    }
     
  4. Fabrice_Lete

    Fabrice_Lete

    Unity Technologies

    Joined:
    May 5, 2018
    Posts:
    55
    nicolasgramlich likes this.
  5. nicolasgramlich

    nicolasgramlich

    Joined:
    Sep 21, 2017
    Posts:
    231