Page 1 of 1

An item with the same key has been added key:null

Posted: Mon Jun 10, 2019 4:07 am
by cragggle
Can't work out whats caused this as the project has been working fine all night.
I replaced placeholder gameobjects with updated models if it helps anyone solve this issue.

ArgumentException: An item with the same key has already been added. Key: null
System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) (at <23c160f925be47d7a4fd083a3a62c920>:0)
System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) (at <23c160f925be47d7a4fd083a3a62c920>:0)
ES3Internal.ES3SerializableDictionary`2[TKey,TVal].OnAfterDeserialize () (at Assets/Plugins/Easy Save 3/Scripts/ES3SerializableDictionary.cs:42)

An item with the same key has been added key:null

Posted: Mon Jun 10, 2019 12:11 pm
by cragggle
I posted in the ES2 forum by mistake, think posting here might help, ill update the other if i get a reply in either.

I can't work out whats caused this as the project has been working fine all night.
I replaced placeholder gameobjects with updated models and deleted previous ones but the key doesn't match what's in the attached prefab scripts.
I've tried deleting playerprefs and save files, removed and re-added ES3 all together and still the same error.
The project is currently unplayable.

ArgumentException: An item with the same key has already been added. Key: null
System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) (at <23c160f925be47d7a4fd083a3a62c920>:0)
System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) (at <23c160f925be47d7a4fd083a3a62c920>:0)
ES3Internal.ES3SerializableDictionary`2[TKey,TVal].OnAfterDeserialize () (at Assets/Plugins/Easy Save 3/Scripts/ES3SerializableDictionary.cs:42)


[EDIT]
Spent 4.5 hours today trying different things to get this fixed,
I randomly started getting errors regarding Non convex meshes being no longer supported on a certain model even though it has a convex mesh on it, I deleted the mesh collision, added a box one, updated the prefab and then removed the box and re-added the mesh collision and once again updated the prefab and strangely that seemed to have fixed it... for now.
If anyone does have any idea what caused this still, as i had 4+ hours of only getting the above error and nothing about the mesh collider, would be amazing if you can shed some light on this.

Re: An item with the same key has been added key:null

Posted: Mon Jun 10, 2019 4:49 pm
by Joel
Hi there,

We've had no reports of this. Please could you PM me a basic project and instructions to replicate this?

EDIT: Just seen your second post and merged it with this topic. Not sure how that would have an effect on it, but it sounds like this might be a bug at Unity's end, as it's happening during Unity's serialisation process. If you manage to create a project which replicates it, please do PM it over if you get a chance.

All the best,
Joel