GetHashCodeFunc' for which no ahead of time (AOT) code was generated

Tried to upgrade a sample dots netcode project to Unity 2021.3.4f1 and build the android build. The android build doesn’t work properly anymore.

ExecutionEngineException: Attempting to call method 'Unity.Entities.FastEquality+GetHashCodeImpl1[[Unity.Entities.SceneSection, Unity.Entities, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]::GetHashCodeFunc' for which no ahead of time (AOT) code was generated. Unity.Entities.TypeManager.GetHashCode (System.Void* val, System.Int32 typeIndex) (at <00000000000000000000000000000000>:0) Unity.Entities.TypeManager.GetHashCode (System.Object val, System.Int32 typeIndex) (at <00000000000000000000000000000000>:0) Unity.Entities.Serialization.SerializeUtility.ReadSharedComponents (Unity.Entities.ExclusiveEntityTransaction manager, Unity.Entities.Serialization.ManagedObjectBinaryReader managedDataReader, Unity.Collections.NativeArray1[T] sharedComponentRemap, Unity.Collections.NativeArray`1[T] sharedComponentRecordArray) (at <00000000000000000000000000000000>:0)
Unity.Entities.Serialization.SerializeUtility.EndDeserializeWorld (Unity.Entities.ExclusiveEntityTransaction manager, Unity.Entities.Serialization.DotsSerializationReader dotsReader, Unity.Entities.Serialization.SerializeUtility+WorldDeserializationStatus& status, Unity.Entities.Serialization.SerializeUtility+WorldDeserializationResult& deserializationResult, System.Object[ ] unityObjects) (at <00000000000000000000000000000000>:0)
Unity.Scenes.AsyncLoadSceneOperation+AsyncLoadSceneJob.Execute () (at <00000000000000000000000000000000>:0)
Unity.Scenes.SceneSectionStreamingSystem:UpdateLoadOperation(AsyncLoadSceneOperation, World, Entity, Boolean)
Unity.Scenes.SceneSectionStreamingSystem:processActiveStreams()
Unity.Scenes.SceneSectionStreamingSystem:OnUpdate()
Unity.Entities.SystemBase:Update()
Unity.Entities.ComponentSystemGroup:UpdateAllSystems()
Unity.Entities.ComponentSystem:Update()
Unity.Entities.ComponentSystemGroup:UpdateAllSystems()
Unity.Entities.ComponentSystem:Update()

Error when processing ‘AsyncLoadSceneJob(jar:file:///data/app/~~DeF-pQRQqEw-HbknVUpgxA==/com.DefaultCompany.NetCube-YGehwBMMya8Exs69qNxKrw==/base.apk!/assets/EntityScenes/b3b4427e1963245ed97bcf69eaca92da.0.entities)’: Attempting to call method ‘Unity.Entities.FastEquality+GetHashCodeImpl`1[[Unity.Entities.SceneSection, Unity.Entities, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]::GetHashCodeFunc’ for which no ahead of time (AOT) code was generated.
Unity.Scenes.SceneSectionStreamingSystem:UpdateLoadOperation(AsyncLoadSceneOperation, World, Entity, Boolean)
Unity.Scenes.SceneSectionStreamingSystem:processActiveStreams()
Unity.Scenes.SceneSectionStreamingSystem:OnUpdate()
Unity.Entities.SystemBase:Update()
Unity.Entities.ComponentSystemGroup:UpdateAllSystems()
Unity.Entities.ComponentSystem:Update()
Unity.Entities.ComponentSystemGroup:UpdateAllSystems()
Unity.Entities.ComponentSystem:Update()

Not a netcode issue specifically - building Il2cpp is broken with Entities.

Empty project, default DOTS packages, build il2cpp any shared component breaks. Mono works on platforms that support it. Upgrading properties package does not fix it.

2 Likes

Is there anyway to hack around this bug? Is it reported? :slight_smile:

https://forum.unity.com/threads/executionengineexception-attempting-to-call-method-unity-entities-fastequality-compareimpl-1.1296462/#post-8317629

1 Like

Thanks, it appears it fixes it for dev only, non development builds still crash for me with linux il2cpp…