Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Save sys works in editor, but doesnt work on android

Discussion in 'Android' started by GUCCIFLEXUS, Apr 30, 2024.

  1. GUCCIFLEXUS

    GUCCIFLEXUS

    Joined:
    Sep 26, 2023
    Posts:
    2
    Log cat got only one type of error
    2024.05.01 00:34:02.547 1855 2890 Error libprocessgroup set_timerslack_ns write failed: Operation not permitted

    Works perfectly in editor. On android it says that Missiondata is null
    Here's the code
    Code (CSharp):
    1.  
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. //#if !(UNITY_WP8 || UNITY_WP8_1)
    5. using System.Runtime.Serialization.Formatters.Binary;
    6. //#endif
    7. using System.Xml.Serialization;
    8. using System.IO;
    9. using System;
    10. using UnityEngine;
    11.  
    12. [DisallowMultipleComponent]
    13. /// <summary>
    14. /// Data manager.
    15. /// (Manages saving(writing)/loading(reading) the data of the game)
    16. /// </summary>
    17. public class DataManager : MonoBehaviour
    18. {
    19.     /// <summary>
    20.     /// The name of the file without the extension.
    21.     /// </summary>
    22.     public string fileName = "findthepairs";  
    23.  
    24.     /// <summary>
    25.     /// The serilization method for reading and writing.
    26.     /// </summary>
    27.     public SerilizationMethod serilizationMethod;
    28.    
    29.     /// <summary>
    30.     /// The scene missions data.
    31.     /// (will be loaded from the Missions scene)
    32.     /// </summary>
    33.     private List<MissionData> sceneMissionsData;
    34.    
    35.     /// <summary>
    36.     /// The file missions data.
    37.     /// (will be loaded from the file)
    38.     /// </summary>
    39.     private List<MissionData> fileMissionsData;
    40.    
    41.     /// <summary>
    42.     /// The filterd missions data.
    43.     /// (The final missions data after filtering)
    44.     /// </summary>
    45.     public List<MissionData> filterdMissionsData;
    46.    
    47.     /// <summary>
    48.     /// The path of the file.
    49.     /// </summary>
    50.     private string filePath;
    51.    
    52.     /// <summary>
    53.     /// Whether the Missions data is empty or null.
    54.     /// </summary>
    55.     private bool isNullOrEmpty;
    56.    
    57.     /// <summary>
    58.     /// Whether it's need to save new data.
    59.     /// </summary>
    60.     private bool needsToSaveNewData;
    61.    
    62.     /// <summary>
    63.     /// The public DataManager instance.
    64.     /// </summary>
    65.     public static DataManager instance;
    66.    
    67.     void Awake ()
    68.     {
    69.         if (instance == null) {
    70.             instance = this;
    71.             DontDestroyOnLoad (gameObject);
    72.         } else {
    73.             Destroy(gameObject);
    74.             return;
    75.         }
    76.        
    77.         #if UNITY_IPHONE
    78.         //Enable the MONO_REFLECTION_SERIALIZER(For IOS Platform Only)
    79.         System.Environment.SetEnvironmentVariable ("MONO_REFLECTION_SERIALIZER", "yes");
    80.         #endif
    81.        
    82.     }
    83.    
    84.     /// <summary>
    85.     /// Inits the game data.
    86.     /// </summary>
    87.     public void InitGameData ()
    88.     {
    89.         ///Reset flags
    90.         isNullOrEmpty = false;
    91.         needsToSaveNewData = false;
    92.        
    93.         ///Load Missions data from the Missions Scene
    94.         sceneMissionsData = LoadMissionsDataFromScene ();
    95.         if (sceneMissionsData == null) {
    96.             return;
    97.         }
    98.        
    99.         if (sceneMissionsData.Count == 0) {
    100.             return;
    101.         }
    102.        
    103.         ///Load Missions data from the file
    104.         fileMissionsData = LoadMissionsFromFile ();
    105.        
    106.         if (fileMissionsData == null) {
    107.             isNullOrEmpty = true;
    108.         } else {
    109.             if (fileMissionsData.Count == 0) {
    110.                 isNullOrEmpty = true;
    111.             }
    112.         }
    113.        
    114.         ///If the Missions data in the file is null or empty,then save the scene Missions data to the file
    115.         if (isNullOrEmpty) {
    116.             SaveMissionsToFile (sceneMissionsData);
    117.             filterdMissionsData = sceneMissionsData;
    118.         } else {
    119.             ///Otherwise get the filtered Missions Data
    120.             filterdMissionsData = GetFilterdMissionsData ();
    121.            
    122.             ///If it's need to save a new Missions data to the file ,then save it
    123.             if (needsToSaveNewData) {
    124.                 SaveMissionsToFile (filterdMissionsData);
    125.             }
    126.         }
    127.     }
    128.    
    129.     ///MissionData is class used for persistent loading and saving
    130.     [System.Serializable]
    131.     public class MissionData
    132.     {
    133.         public int ID;//the ID of the Mission
    134.         public bool isLocked = true;
    135.         public List<LevelData> levelsData = new List<LevelData> ();//the levels of the mission
    136.        
    137.         /// <summary>
    138.         /// Find the level data by ID.
    139.         /// </summary>
    140.         /// <returns>The level data.</returns>
    141.         /// <param name="ID">the ID of the level.</param>
    142.         public LevelData FindLevelDataById (int ID)
    143.         {
    144.             foreach (LevelData levelData in levelsData) {
    145.                 if (levelData.ID == ID) {
    146.                     return levelData;
    147.                 }
    148.             }
    149.             return null;
    150.         }
    151.     }
    152.    
    153.     ///LevelData is class used for persistent loading and saving
    154.     [System.Serializable]
    155.     public class LevelData
    156.     {
    157.         public int ID;//The id of the level
    158.         public bool isLocked = true;
    159.         public TableLevel.StarsNumber starsNumber = TableLevel.StarsNumber.ZERO;//number of stars (stars rating)
    160.     }
    161.    
    162.     /// <summary>
    163.     /// Reset the game data.
    164.     /// </summary>
    165.     public void ResetGameData ()
    166.     {
    167.         try {
    168.             fileMissionsData = LoadMissionsFromFile ();
    169.            
    170.             if (fileMissionsData == null) {
    171.                 return;
    172.             }
    173.            
    174.             ///Reset the levels of each mission
    175.             foreach (MissionData missionData in fileMissionsData) {
    176.                 if (missionData == null) {
    177.                     continue;
    178.                 }
    179.  
    180.                 if(missionData.ID == 1){
    181.                     missionData.isLocked = false;
    182.                 }else{
    183.                     missionData.isLocked = true;
    184.                 }
    185.  
    186.                 foreach (LevelData levelData in missionData.levelsData) {
    187.                     if (levelData == null) {
    188.                         continue;
    189.                     }
    190.                    
    191.                     ///UnLock the level of ID equals 1(first level) ,otherwise lock the others
    192.                     if (levelData.ID == 1) {
    193.                         levelData.isLocked = false;
    194.                     } else {
    195.                         levelData.isLocked = true;
    196.                     }
    197.                    
    198.                     ///Set stars number to zero for each level
    199.                     levelData.starsNumber = TableLevel.StarsNumber.ZERO;
    200.                 }
    201.             }
    202.            
    203.             SaveMissionsToFile (fileMissionsData);
    204.         } catch (Exception ex) {
    205.             Debug.Log (ex.Message);
    206.             return;
    207.         }
    208.         Debug.Log ("Game Data has been reset successfully");
    209.     }
    210.    
    211.     /// <summary>
    212.     /// Load the missions data from the scene.
    213.     /// </summary>
    214.     /// <returns>The missions data from the scene.</returns>
    215.     private List<MissionData> LoadMissionsDataFromScene ()
    216.     {
    217.         Debug.Log ("Loading Missions Data from Scene");
    218.        
    219.         GameObject [] missions = UIExtension.FindGameObjectsWithTag ("Mission");;
    220.        
    221.         if (missions == null) {
    222.             Debug.Log ("No Mission with 'Mission' tag found");
    223.             return null;
    224.         }
    225.        
    226.         Mission tempMission = null;
    227.         LevelsManager tempLevelManager = null;
    228.        
    229.         List<MissionData> tempMissionsData = new List<MissionData> ();
    230.         MissionData tempMissionData = null;
    231.         for (int i = 0 ; i < missions.Length ;i++) {
    232.  
    233.             tempMission = missions[i].GetComponent<Mission> ();
    234.             tempLevelManager =  missions[i].GetComponent<LevelsManager> ();
    235.             tempMissionData = new MissionData ();
    236.             if(i == 0){
    237.                 tempMissionData.isLocked = false;
    238.             }
    239.             tempMissionData.ID = tempMission.ID;
    240.             tempMissionData.levelsData = GetLevelData (tempLevelManager.levels);
    241.            
    242.             tempMissionsData.Add (tempMissionData);
    243.         }
    244.        
    245.         return tempMissionsData;
    246.     }
    247.    
    248.    
    249.     /// <summary>
    250.     /// Get the level data.
    251.     /// </summary>
    252.     /// <returns>The new levels data.</returns>
    253.     /// <param name="levels">The current levels data.</param>
    254.     private List<LevelData> GetLevelData (List<Level> levels)
    255.     {
    256.         if (levels == null) {
    257.             return null;
    258.         }
    259.        
    260.         LevelData tempLevelData = null;
    261.         List<LevelData> tempLevelsData = new List<LevelData> ();
    262.         int ID = 1;
    263.         for (int i = 0; i <levels.Count; i++) {
    264.             tempLevelData = new LevelData ();
    265.             tempLevelData.ID = ID;
    266.             ID++;
    267.             if (i == 0) {
    268.                 ///First level must be unlocked
    269.                 tempLevelData.isLocked = false;
    270.             }
    271.             tempLevelsData.Add (tempLevelData);
    272.         }
    273.        
    274.         return tempLevelsData;
    275.     }
    276.    
    277.     /// <summary>
    278.     /// Get the filterd missions data.
    279.     /// (Compare the Missions data in the file with the Missions data in the scene)
    280.     /// Scenario :
    281.     /// -you may have a set of missions saved into file
    282.     /// -if you add/delete a mission using inspector
    283.     /// -then it's need to determine and save the new data
    284.     /// </summary>
    285.     /// <returns>The filterd missions data.</returns>
    286.     private List<MissionData> GetFilterdMissionsData ()
    287.     {
    288.         if (fileMissionsData == null || sceneMissionsData == null) {
    289.             return null;
    290.         }
    291.        
    292.         MissionData tempMissionData = null;
    293.         List<MissionData> tempFilteredMissionsData = new List<MissionData> ();
    294.        
    295.         foreach (MissionData missionData in sceneMissionsData) {
    296.            
    297.             ///Get the mission data from the file
    298.             tempMissionData = FindMissionDataById (missionData.ID, fileMissionsData);
    299.             if (tempMissionData != null) {
    300.                 ///If the number of levels in the scene mission Equals to the number of levels in the file mission
    301.                 if (missionData.levelsData.Count == tempMissionData.levelsData.Count) {
    302.                     ///Add tempMissionData(file mission data) to the filtered list
    303.                     tempFilteredMissionsData.Add (tempMissionData);
    304.                 } else {//Otherwise,its need to save new data
    305.                     //TODO:levels data will be lost,when a level is added or removed
    306.                     needsToSaveNewData = true;
    307.                     ///Add the  missionData(scene mission data) to the filtered list
    308.                     tempFilteredMissionsData.Add (missionData);
    309.                 }
    310.             } else {//Otherwise,its need to save new data
    311.                 needsToSaveNewData = true;
    312.                 ///Add the missionData(scene mission data) to the filtered list
    313.                 tempFilteredMissionsData.Add (missionData);
    314.             }
    315.         }
    316.         return tempFilteredMissionsData;
    317.     }
    318.    
    319.     /// <summary>
    320.     /// Save the missions to file.
    321.     /// </summary>
    322.     /// <param name="missionsData">Missions data.</param>
    323.     public void SaveMissionsToFile (List<MissionData> missionsData)
    324.     {
    325. #if UNITY_ANDROID || UNITY_IPHONE
    326.         if (serilizationMethod == SerilizationMethod.BINARY) {
    327.             SaveDataToBinaryFile (missionsData);
    328.         } else if (serilizationMethod == SerilizationMethod.XML) {
    329.             SaveDataToXMLFile (missionsData);
    330.         }
    331. #elif UNITY_WP8
    332.         if (serilizationMethod == SerilizationMethod.XML) {
    333.             SaveDataToXMLFile (missionsData);
    334.         }
    335.  
    336. #else
    337.         if (serilizationMethod == SerilizationMethod.BINARY) {
    338.             SaveDataToBinaryFile (missionsData);
    339.         } else if (serilizationMethod == SerilizationMethod.XML) {
    340.             SaveDataToXMLFile (missionsData);
    341.         }
    342.         #endif
    343.     }
    344.  
    345.     /// <summary>
    346.     /// Load the missions from file.
    347.     /// </summary>
    348.     /// <returns>The missions from file.</returns>
    349.     public List<MissionData> LoadMissionsFromFile()
    350.     {
    351.         List<MissionData> loadedMissions = null;
    352.  
    353. #if UNITY_ANDROID || UNITY_IPHONE
    354.     if (serilizationMethod == SerilizationMethod.BINARY)
    355.     {
    356.         loadedMissions = LoadDataFromBinaryFile<List<MissionData>>();
    357.     }
    358.     else if (serilizationMethod == SerilizationMethod.XML)
    359.     {
    360.         loadedMissions = LoadDataFromXMLFile<List<MissionData>>();
    361.     }
    362. #elif UNITY_WP8 || UNITY_WP8_1
    363.     if (serilizationMethod == SerilizationMethod.XML)
    364.     {
    365.         loadedMissions = LoadDataFromXMLFile<List<MissionData>>();
    366.     }
    367. #else
    368.         if (serilizationMethod == SerilizationMethod.BINARY)
    369.         {
    370.             loadedMissions = LoadDataFromBinaryFile<List<MissionData>>();
    371.         }
    372.         else if (serilizationMethod == SerilizationMethod.XML)
    373.         {
    374.             loadedMissions = LoadDataFromXMLFile<List<MissionData>>();
    375.         }
    376. #endif
    377.  
    378.         return loadedMissions;
    379.     }
    380.  
    381.  
    382.     /// <summary>
    383.     /// Save the data to XML file.
    384.     /// </summary>
    385.     /// <param name="data">Data.</param>
    386.     public void SaveDataToXMLFile<Type> (Type data)
    387.     {
    388.         ///Setting up file path
    389.         SettingUpFilePath ();
    390.         if (string.IsNullOrEmpty (filePath)) {
    391.             Debug.Log ("Null or Empty path");
    392.             return;
    393.         }
    394.        
    395.         if (data == null) {
    396.             Debug.Log ("Data is Null");
    397.             return;
    398.         }
    399.        
    400.         Debug.Log ("Saving Data to XML File");
    401.        
    402.         XmlSerializer serializer = new XmlSerializer (typeof(Type));
    403.         TextWriter textWriter = new StreamWriter (filePath);
    404.         serializer.Serialize (textWriter, data);
    405.         textWriter.Close ();
    406.     }
    407.    
    408.     /// <summary>
    409.     /// Load the data from XML file.
    410.     /// </summary>
    411.     /// <returns>The data from XML file.</returns>
    412.     public Type LoadDataFromXMLFile<Type> ()
    413.     {
    414.         Type data = default(Type);
    415.        
    416.         ///Setting up file path
    417.         SettingUpFilePath ();
    418.        
    419.         if (string.IsNullOrEmpty (filePath)) {
    420.             Debug.Log ("Null or Empty file path");
    421.             return data;
    422.         }
    423.        
    424.         if (!File.Exists (filePath)) {
    425.             Debug.Log (filePath + " is not exists");
    426.             return data;
    427.         }
    428.        
    429.         Debug.Log ("Loading Data from XML File");
    430.        
    431.         XmlSerializer deserializer = new XmlSerializer (typeof(Type));
    432.         TextReader textReader = new StreamReader (filePath);
    433.         data = (Type)deserializer.Deserialize (textReader);
    434.         textReader.Close ();
    435.        
    436.         return data;
    437.     }
    438.    
    439.     /// <summary>
    440.     /// Save data to the binary file.
    441.     /// </summary>
    442.     /// <param name="data"> The data.</param>
    443.     public void SaveDataToBinaryFile<Type> (Type data)
    444.     {
    445.         #if !(UNITY_WP8 || UNITY_WP8_1)
    446.         ///Setting up file path
    447.         SettingUpFilePath ();
    448.         if (string.IsNullOrEmpty (filePath)) {
    449.             Debug.Log ("Null or Empty file path");
    450.             return;
    451.         }
    452.        
    453.         if (data == null) {
    454.             Debug.Log ("Data is Null");
    455.             return;
    456.         }
    457.        
    458.         Debug.Log ("Saving Data to Binary File");
    459.        
    460.         FileStream file = null;
    461.         try {
    462.             BinaryFormatter bf = new BinaryFormatter ();
    463.             file = File.Open (filePath, FileMode.Create);
    464.             bf.Serialize (file, data);
    465.             file.Close ();
    466.         } catch (Exception ex) {
    467.             file.Close ();
    468.             Debug.LogError ("Exception : " + ex.Message);
    469.         }
    470.         #endif
    471.     }
    472.    
    473.     /// <summary>
    474.     /// Load data from the binary file.
    475.     /// </summary>
    476.     public Type LoadDataFromBinaryFile<Type> ()
    477.     {
    478.         Type data = default(Type);
    479.        
    480.         #if !(UNITY_WP8 || UNITY_WP8_1)
    481.         ///Setting up file path
    482.         SettingUpFilePath ();
    483.         if (string.IsNullOrEmpty (filePath)) {
    484.             Debug.Log ("Null or Empty file path");
    485.             return data;
    486.         }
    487.        
    488.         if (!File.Exists (filePath)) {
    489.             Debug.Log (filePath + " is not exists");
    490.             return data;
    491.         }
    492.        
    493.         Debug.Log ("Loading Data from Binary File");
    494.        
    495.        
    496.         FileStream file = null;
    497.         try {
    498.             BinaryFormatter bf = new BinaryFormatter ();
    499.             file = File.Open (filePath, FileMode.Open);
    500.             data = (Type)bf.Deserialize (file);
    501.             file.Close ();
    502.         } catch (Exception ex) {
    503.             file.Close ();
    504.             Debug.LogError ("Exception : " + ex.Message);
    505.         }
    506.         #endif
    507.         return data;
    508.     }
    509.    
    510.     /// <summary>
    511.     /// Finds the mission data by id.
    512.     /// </summary>
    513.     /// <returns>The mission data by ID.</returns>
    514.     /// <param name="ID">the ID of the mission.</param>
    515.     /// <param name="missionsData">Missions data list to search in.</param>
    516.     public static MissionData FindMissionDataById (int ID, List<MissionData> missionsData)
    517.     {
    518.         if (missionsData == null) {
    519.             return null;
    520.         }
    521.        
    522.         foreach (MissionData missionData in missionsData) {
    523.             if (missionData.ID == ID) {
    524.                 return missionData;
    525.             }
    526.            
    527.         }
    528.        
    529.         return null;
    530.     }
    531.    
    532.     /// <summary>
    533.     /// Settings up the path of the file ,relative to the current platform.
    534.     /// </summary>
    535.     private void SettingUpFilePath ()
    536.     {
    537.         string fileExtension = "";
    538.         Debug.Log("Persistent Data Path: " + Application.persistentDataPath);
    539.  
    540. #if UNITY_ANDROID
    541.         //Get Android Path
    542.         filePath = GetAndroidFileFolder();
    543.         if (serilizationMethod == SerilizationMethod.BINARY) {
    544.             fileExtension = ".bin";
    545.         } else if (serilizationMethod == SerilizationMethod.XML) {
    546.             fileExtension = ".xml";
    547.         }
    548. #elif UNITY_IPHONE
    549.         //Get iPhone Documents Path
    550.         filePath = GetIPhoneFileFolder();
    551.         if (serilizationMethod == SerilizationMethod.BINARY) {
    552.             fileExtension = ".bin";
    553.         } else if (serilizationMethod == SerilizationMethod.XML) {
    554.             fileExtension = ".xml";
    555.         }
    556. #elif UNITY_WP8 || UNITY_WP8_1
    557.         //Get Windows Phone 8 Path
    558.         filePath = GetWP8FileFolder();
    559.         if (serilizationMethod == SerilizationMethod.XML) {
    560.             fileExtension = ".xml";
    561.         }
    562. #else
    563.         //Others
    564.         filePath = GetOthersFileFolder ();
    565.         if (serilizationMethod == SerilizationMethod.BINARY) {
    566.             fileExtension = ".bin";
    567.         } else if (serilizationMethod == SerilizationMethod.XML) {
    568.             fileExtension = ".xml";
    569.         }
    570.         #endif
    571.         filePath += "/" + fileName + fileExtension;
    572.     }
    573.    
    574.     public static string GetAndroidFileFolder ()
    575.     {
    576.         return Application.persistentDataPath;
    577.     }
    578.    
    579.     public static string GetIPhoneFileFolder ()
    580.     {
    581.         return Application.persistentDataPath;
    582.     }
    583.    
    584.     public static string GetWP8FileFolder ()
    585.     {
    586.         return Application.dataPath;
    587.     }
    588.    
    589.     public static string GetOthersFileFolder ()
    590.     {
    591.         return Application.dataPath;
    592.     }
    593.  
    594.  
    595.  
    596.     public enum SerilizationMethod
    597.     {
    598.         #if UNITY_WP8 || UNITY_WP8_1
    599.         XML
    600.         #else
    601.         BINARY,
    602.         XML,
    603.         #endif
    604.     }
    605.     ;  
    606. }
    607.  
    in my manifest i gave theese permissions
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

    Code (CSharp):
    1. <?xml version="1.0" encoding="utf-8"?>
    2. <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    3.     xmlns:tools="http://schemas.android.com/tools"
    4.     package="com.unity3d.player" >
    5.  
    6.     <uses-sdk
    7.         android:minSdkVersion="22"
    8.         android:targetSdkVersion="32" />
    9.  
    10.     <uses-feature android:glEsVersion="0x00020000" />
    11.     <uses-feature
    12.         android:name="android.hardware.touchscreen"
    13.         android:required="false" />
    14.     <uses-feature
    15.         android:name="android.hardware.touchscreen.multitouch"
    16.         android:required="false" />
    17.     <uses-feature
    18.         android:name="android.hardware.touchscreen.multitouch.distinct"
    19.         android:required="false" />
    20.  
    21.     <application
    22.         android:extractNativeLibs="true"
    23.         android:isGame="true" >
    24.         <meta-data
    25.             android:name="unity.splash-mode"
    26.             android:value="0" />
    27.         <meta-data
    28.             android:name="unity.splash-enable"
    29.             android:value="True" />
    30.         <meta-data
    31.             android:name="unity.launch-fullscreen"
    32.             android:value="True" />
    33.         <meta-data
    34.             android:name="unity.allow-resizable-window"
    35.             android:value="False" />
    36.         <meta-data
    37.             android:name="notch.config"
    38.             android:value="portrait|landscape" />
    39.         <meta-data
    40.             android:name="unity.auto-report-fully-drawn"
    41.             android:value="true" />
    42.  
    43.         <activity
    44.             android:name="com.unity3d.player.UnityPlayerActivity"
    45.             android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density"
    46.             android:exported="true"
    47.             android:hardwareAccelerated="false"
    48.             android:launchMode="singleTask"
    49.             android:resizeableActivity="false"
    50.             android:screenOrientation="portrait"
    51.             android:theme="@style/UnityThemeSelector" >
    52.             <intent-filter>
    53.                 <category android:name="android.intent.category.LAUNCHER" />
    54.                 <category android:name="android.intent.category.LEANBACK_LAUNCHER" />
    55.  
    56.                 <action android:name="android.intent.action.MAIN" />
    57.             </intent-filter>
    58.  
    59.             <meta-data
    60.                 android:name="unityplayer.UnityActivity"
    61.                 android:value="true" />
    62.             <meta-data
    63.                 android:name="notch_support"
    64.                 android:value="true" />
    65.         </activity>
    66.     </application>
    67. <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    68. <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    69. </manifest>
    Please guys help, I dont know what to do already....
     
  2. digipaul

    digipaul

    Joined:
    Nov 24, 2018
    Posts:
    49
    Sounds like you are writing to a folder you don't have permission to write to. On android you should be able to write to Application.persistentDataPath . On android 11+ the read/write external storage permissions are ignored.
     
  3. GUCCIFLEXUS

    GUCCIFLEXUS

    Joined:
    Sep 26, 2023
    Posts:
    2
    So what can I do?