Suddenly assertion failed errors in 2020.3.19

No clue what it is and how to fix it but when I quit my build these errors are thrown.

Also after updating unity from 17 to 19 LTS, the saving/loading of keybindings suddenly doesnt work anymore with this code. ¯_(ツ)_/¯

Seems to happen mainly in development builds

Which code are you trying to use? SaveBindingOverridesAsJson / LoadBindingOverridesFromJson or older code from one of the first answers in that thread?

The older code in the second post by Rene-damm.

SaveBindingOverridesAsJson / LoadBindingOverridesFromJson isn’t available in Playerinput.actions. (using version 1.18.16)

Only PlayerInput.actions.LoadFromJson and that doesn’t seem to work.

@lejean_1 this should work on 1.1.1:

  void SaveUserRebinds(PlayerInput player)
  {
      var rebinds = player.actions.SaveBindingOverridesAsJson();
      PlayerPrefs.SetString("rebinds", rebinds);
  }

  void LoadUserRebinds(PlayerInput player)
  {
      var rebinds = PlayerPrefs.GetString("rebinds");
      player.actions.LoadBindingOverridesFromJson(rebinds);
  }