XML Serialization doesn't work on Android

Hi Everyone. I have save system for my game. Script is working on Windows and Editor. But it is not working on Android Build.

This is my save system

using UnityEngine;
using System.Xml.Serialization;
using System.IO;

public class SaveManager : MonoBehaviour
{
    public static void SaveGame(GameData data, string savePath)
    {
        XmlSerializer serializer = new XmlSerializer(data.GetType());
        using (StreamWriter writer = new StreamWriter(savePath))
        {
            serializer.Serialize(writer, data);
        }
    }

    public static GameData LoadGame(string loadPath)
    {
        if (File.Exists(loadPath))
        {
            XmlSerializer serializer = new XmlSerializer(typeof(GameData));
            StreamReader reader = new StreamReader(loadPath);
            GameData gd = serializer.Deserialize(reader) as GameData;
            reader.Close();
            return gd;
        }

        else
        {
            Debug.Log("There is no save file at " + loadPath);
            return new GameData();
        }
    }

I use this code for save game:

SaveManager.SaveGame(data, Application.persistentDataPath + "/save.xml");

This code for load game:

data = SaveManager.LoadGame(Application.persistentDataPath + "/save.xml");

Have you done a logcat and seen if any errors are output?

I’ve never done logcat before. Do i need an additional program?

logcat is part of Android SDK. You can install Logcat package in Unity Editor and you’ll be able to see logcat messages directly in Editor.

Thanks everyone. I solved my problem using json and playerprefs instead of xml serialization