title: Why doesn't my save system work on Android?
body: <p>I've created a code which saves progress in game. In Unity it works perfectly - creates savefile in specified folder, but when I import app to Android it doesn't work. Any clue why?</p>
  
  <p>It's my first time working with saving/loading so it might be buggy as heck. Don't be too harsh on me.</p>
  
  <pre><code>using System.IO;
  using UnityEngine;
  using System.Runtime.Serialization.Formatters.Binary;
  
  public static class SaveSystem
  {
      public static void Save(Helper help)
      {
          BinaryFormatter formatter = new BinaryFormatter();
          string path = Application.persistentDataPath + "/savefile.gut";
          FileStream stream = new FileStream(path, FileMode.Create);
  
          SaveState data = new SaveState(help);
  
          formatter.Serialize(stream, data);
          stream.Close();
      }
  
      public static SaveState Load()
      {
          string path = Application.persistentDataPath + "/savefile.gut";
          if (File.Exists(path))
          {
              BinaryFormatter formatter = new BinaryFormatter();
              FileStream stream = new FileStream(path, FileMode.Open);
  
              SaveState data = formatter.Deserialize(stream) as SaveState;
              stream.Close();
  
              return data;
          }
          else
          {
              Debug.LogError("Save file not found in " + path);
              return null;
          }
      }
  
  }
  </code></pre>
  
  <pre><code>[System.Serializable]
  public class SaveState
  {
      public long[] points;
      public int[] level;
      public long[][] cost;
      public long[][] costAdd;
  
      public SaveState(Helper all)
      {
          points = new long[all.points.Length];
              points = all.points;
  
          level = new int[all.levelButton.Length];
          cost = new long[all.clickable.Length][];
          costAdd = new long[all.clickable.Length][];
  
          for (int i = 0; i &lt; all.clickable.Length; i++)
          {
              level[i] = all.clickable[i].level;
              cost[i] = all.levelButton[i].cost;
              costAdd[i] = all.levelButton[i].costAdd;
          }
      }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/1mdgl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1mdgl.png" alt="enter image description here"></a></p>