#Error when Building player

1 messages · Page 1 of 1 (latest)

deft beacon
#

After building exe i got this: ArgumentException: Cannot find TypeIndex for type hash 6732456654960766380. Check in the debug file ExportedTypes.log of your project Logs folder (<projectName>/Logs) the corresponding Component type name for the type hash 6732456654960766380. And ensure your runtime depends on all assemblies defining the Component types your data uses.

6732456654960766380 is a managed IComponentData, anyone has any clue on how to solve this? Thx!

half minnow
#

What does the component look like?

#

This is usually caused by #if UNITY_EDITOR defines on a component

deft beacon
#

After many blind tries, finaly found out that the reason: you CAN NOT cross reference other managed component inside a managed component, this may cause serilization not working properly (even with [NonSerialized]).

thorn turret
#

would love a repro for that one

#

is it true with any class IComponentData? or monobehaviours? or some other subset?

deft beacon
#

yep, really easy to reproduce, this is all code that needed:

using Unity.Entities;
using UnityEngine;

public class CrossRefAuthoring : MonoBehaviour
{
    class Baker : Baker<CrossRefAuthoring>
    {
        public override void Bake(CrossRefAuthoring authoring)
        {
            AddComponentObject(GetEntity(TransformUsageFlags.None), new CompA());
        }
    }
}

public class CompA : IComponentData
{
    public CompB RefB;
}
public class CompB : IComponentData
{
    public CompA RefA;
}
thorn turret
#

@green helm ^

green helm
#

@deft beacon Which version of entities are you using?

deft beacon
#

newest 1.0.11, unity 2022.3.5 @green helm

green helm
#

Thanks!