Weird serialization exception

Hello everyone.
Suddenly I got the issue after hit the play button.

the most weird thing is that field enemiesAttractedToAutograph does not exist.

3130850--237168--upload_2017-7-3_11-9-17.png
I’ve got tons of other errors from nowhere. I could not find the answer to this, what I’ve already try to do:

  • delete whole register (regedit)
    -reinstal unity, sourcetree
    -update unity
    -a lot of other things I do not remember right now
    All of my teammates have fully working version of project, errors only appear on my PC, and - yes - I have newest version of the project.
    I would really appreciate all answers, hope You can help me. Thank You :slight_smile:

Without more I can only say that you may be serializing/deserializing the wrong object.

Yup, that’s probably it. It’s thrown by SaveLoadManager.LoadFromFile(). Could you post that? You’re probably trying to deserialize the wrong thing - either an old version of the type, or something else entirely.

Edit: You also don’t have to cross out bits of your code. We’re not going to steal your type and field names, ffs.

@Baste Unfortunately I have to, because of my boss, sorry about that.
Thank You for your reply, class SavedAchievements just have a bunch of fields, that’s all:
3131081--237196--upload_2017-7-3_14-45-1.png

I also include Load method

If I try to deserialize wrong thing, how is it possible, that my teammates does not have this problem? Isn’t that weird?

@
If I add field “enemiesAttractedToAutograph” error disappear, but new one (exactly the same) appears, with other field, so I add that ‘other field’ and next one error appears. After adding 10 new fields I gave up, because it is not the solution

It seems like the achievement file is broken. Your binary deserializer is finding fields that are not there, and crashes. Going to guess that some other file has been copied to that location. I assume your framework has the ability to delete/reset it somehow? Try that.

This is the big downside with binary serialization as opposed to string-based serialization. It’s faster, sure, but it doesn’t handle changing what fields are there very well.

1 Like

Problem solved. Thank You @Baste for Your help, I really appreciate it.
Solution:

  1. Go to folder where you store your saved files (If You use Application.persistentDataPath, and don’t know how to find this, just use Debug.Log(Application.persistentDataPath) to check the path.
  2. Delete your saved files