[0.50] Failed to load subscene

After I upgraded my big project to 0.50, android build not longer working that failed to load subscene properly. Any idea why and how to fix it?

KeyNotFoundException: The given key was not present in the dictionary.
System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) (at :0)
Unity.Scenes.SerializeUtilityHybrid.DeserializeObjectReferences (Unity.Scenes.ReferencedUnityObjects objRefs, UnityEngine.Object[ ]& objectReferences) (at C:/Project/Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Scenes/Hybrid/SerializeUtilityHybrid.cs:105)
Unity.Scenes.AsyncLoadSceneOperation.ScheduleSceneRead () (at C:/Project/Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Scenes/AsyncLoadSceneOperation.cs:488)
Unity.Scenes.AsyncLoadSceneOperation.UpdateAsync () (at C:/Project/Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Scenes/AsyncLoadSceneOperation.cs:443)
UnityEngine.Debug:LogException(Exception)
Unity.Debug:LogException(Exception) (at C:/Project/Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Entities/Stubs/Unity/Debug.cs:19)
Unity.Scenes.SceneSectionStreamingSystem:UpdateLoadOperation(AsyncLoadSceneOperation, World, Entity, Boolean) (at C:/Project/Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Scenes/SceneSectionStreamingSystem.cs:505)
Unity.Scenes.SceneSectionStreamingSystem:processActiveStreams() (at C:/Project/Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Scenes/SceneSectionStreamingSystem.cs:369)
Unity.Scenes.SceneSectionStreamingSystem:OnUpdate() (at C:/Project/Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Scenes/SceneSectionStreamingSystem.cs:616)
Unity.Entities.SystemBase:Update() (at C:/Project/Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Entities/SystemBase.cs:400)
Unity.Entities.ComponentSystemGroup:UpdateAllSystems() (at C:/Project/Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Entities/ComponentSystemGroup.cs:583)
Unity.Entities.ComponentSystemGroup:OnUpdate() (at C:/Project/Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Entities/ComponentSystemGroup.cs:523)
Unity.Entities.ComponentSystem:Update() (at C:/Project/Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Entities/ComponentSystem.cs:114)
Unity.Entities.ComponentSystemGroup:UpdateAllSystems() (at C:/Project/Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Entities/ComponentSystemGroup.cs:583)
Unity.Entities.ComponentSystemGroup:OnUpdate() (at C:/Project/Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Entities/ComponentSystemGroup.cs:523)
Unity.Entities.InitializationSystemGroup:OnUpdate() (at C:/Project/Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Entities/DefaultWorld.cs:28)
Unity.Entities.ComponentSystem:Update() (at C:/Project/Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Entities/ComponentSystem.cs:114)
Unity.Entities.ComponentSystemGroup:UpdateAllSystems() (at C:/Project/Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Entities/ComponentSystemGroup.cs:583)
Unity.Entities.ComponentSystemGroup:OnUpdate() (at C:/Project/Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Entities/ComponentSystemGroup.cs:523)
Unity.Entities.ComponentSystem:Update() (at C:/Project/Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Entities/ComponentSystem.cs:114)
Unity.Entities.ComponentSystemGroup:UpdateAllSystems() (at C:/Project/Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Entities/ComponentSystemGroup.cs:583)
Unity.Entities.ComponentSystemGroup:OnUpdate() (at C:/Project/Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Entities/ComponentSystemGroup.cs:523)
Unity.Entities.InitializationSystemGroup:OnUpdate() (at C:/Project/Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Entities/DefaultWorld.cs:28)
Unity.Entities.ComponentSystem:Update() (at C:/Project/Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Entities/ComponentSystem.cs:114)
Unity.Entities.DummyDelegateWrapper:TriggerUpdate() (at C:/Project/Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Entities/ScriptBehaviourUpdateOrder.cs:426)

Error when processing ‘AsyncLoadSceneJob(jar:file:///data/app/~~sd76hIH4NArfahTsZkqmzw==/com.xxx.xxx-og4dfzdCpXDM995xbx4qXA==/base.apk!/assets/EntityScenes/839b829ef2a7ee9449ddb5065462ef59.0.entities)’: The given key was not present in the dictionary.
UnityEngine.Debug:LogWarning (object)
Unity.Debug:LogWarning (object) (at C:/Project/Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Entities/Stubs/Unity/Debug.cs:15)
Unity.Scenes.SceneSectionStreamingSystem:UpdateLoadOperation (Unity.Scenes.AsyncLoadSceneOperation,Unity.Entities.World,Unity.Entities.Entity,bool) (at C:/Project/Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Scenes/SceneSectionStreamingSystem.cs:506)
Unity.Scenes.SceneSectionStreamingSystem:processActiveStreams () (at C:/Project/Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Scenes/SceneSectionStreamingSystem.cs:369)
Unity.Scenes.SceneSectionStreamingSystem:OnUpdate () (at C:/Project/Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Scenes/SceneSectionStreamingSystem.cs:616)
Unity.Entities.SystemBase:Update () (at C:/Project/Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Entities/SystemBase.cs:400)
Unity.Entities.ComponentSystemGroup:UpdateAllSystems () (at C:/Project/Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Entities/ComponentSystemGroup.cs:583)
Unity.Entities.ComponentSystemGroup:OnUpdate () (at C:/Project/Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Entities/ComponentSystemGroup.cs:523)
Unity.Entities.ComponentSystem:Update () (at C:/Project/Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Entities/ComponentSystem.cs:114)
Unity.Entities.ComponentSystemGroup:UpdateAllSystems () (at C:/Project/Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Entities/ComponentSystemGroup.cs:583)
Unity.Entities.ComponentSystemGroup:OnUpdate () (at C:/Project/Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Entities/ComponentSystemGroup.cs:523)
Unity.Entities.InitializationSystemGroup:OnUpdate () (at C:/Project/Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Entities/DefaultWorld.cs:28)
Unity.Entities.ComponentSystem:Update () (at C:/Project/Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Entities/ComponentSystem.cs:114)
Unity.Entities.ComponentSystemGroup:UpdateAllSystems () (at C:/Project/Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Entities/ComponentSystemGroup.cs:583)
Unity.Entities.ComponentSystemGroup:OnUpdate () (at C:/Project/Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Entities/ComponentSystemGroup.cs:523)
Unity.Entities.ComponentSystem:Update () (at C:/Project/Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Entities/ComponentSystem.cs:114)
Unity.Entities.ComponentSystemGroup:UpdateAllSystems () (at C:/Project/Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Entities/ComponentSystemGroup.cs:583)
Unity.Entities.ComponentSystemGroup:OnUpdate () (at C:/Project/Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Entities/ComponentSystemGroup.cs:523)
Unity.Entities.InitializationSystemGroup:OnUpdate () (at C:/Project/Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Entities/DefaultWorld.cs:28)
Unity.Entities.ComponentSystem:Update () (at C:/Project/Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Entities/ComponentSystem.cs:114)
Unity.Entities.ScriptBehaviourUpdateOrder/DummyDelegateWrapper:TriggerUpdate () (at C:/Project/Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Entities/ScriptBehaviourUpdateOrder.cs:426)

The same on my side

2022.03.22 14:11:10.404 7982 8380 Error Unity ArgumentException: We are reading a UnityEngine.Object but the deserialized index is out of range for the given object table.
2022.03.22 14:11:10.404 7982 8380 Error Unity   at Unity.Entities.Serialization.ManagedObjectBinaryReader.Unity.Serialization.Binary.Adapters.Contravariant.IBinaryAdapter<UnityEngine.Object>.Deserialize (Unity.Collections.LowLevel.Unsafe.UnsafeAppendBuffer+Reader* reader) [0x00000] in <00000000000000000000000000000000>:0
2022.03.22 14:11:10.404 7982 8380 Error Unity   at Unity.Serialization.Binary.Adapters.BinaryAdapterCollection.TryDeserialize[TValue] (Unity.Serialization.Binary.Adapters.IBinaryAdapter adapter, Unity.Collections.LowLevel.Unsafe.UnsafeAppendBuffer+Reader* buffer, TValue& value) [0x00000] in <00000000000000000000000000000000>:0
2022.03.22 14:11:10.404 7982 8380 Error Unity   at Unity.Serialization.Binary.Adapters.BinaryAdapterCollection.TryDeserialize[TValue] (Unity.Collections.LowLevel.Unsafe.UnsafeAppendBuffer+Reader* stream, TValue& value) [0x00000] in <00000000000000000000000000000000>:0
2022.03.22 14:11:10.404 7982 8380 Error Unity   at Unity.Serialization.Binary.BinaryPropertyReader.ReadValue[TValue] (TValue& value, System.Boolean isRoot) [

The error happens when trying to read value of type GameObject

Hi @elliotc-unity . Did any dots developer aware of this issue? I need unofficial hotfix for me to fix it locally. I need to get 0.50 up and running asap.

I don’t know what’s causing it, but an internal slack search suggests that clearing the entity dependency cache has sometimes fixed it in the past. Can you try that and let us know if it fixes it?

@elliotc-unity

This error caused by the following piece of code:

[System.Serializable]
    public sealed class Projectile : IComponentData
    {
        [System.NonSerialized] public GameObject AppearanceInstance;
        [System.NonSerialized] public GameObject ExplosionPrefab;
    }

the error is gone when I removed the [NonSerialized] part

1 Like

getting this here, any fix?

1 Like

Getting same error on 1.2.0 pre 6 and 12

2 Likes

I had some TextMeshPro assets in my subscene which I deleted and it fixed the issue for me.