0 votes
by (180 points)

Hello!
I am try save file on path "/storage/emulated/0/" with Unity applicaiton, but alltime throw mistake.
Permission on android manifest
WRITEEXTERNALSTORAGE, READEXTERNALSTORAGE ,MANAGEEXTERNALSTORAGE.
On pico neo 2 all work fine.

 File.CreateText(path).Dispose();
        using (TextWriter writer = new StreamWriter(path, false))
        {
            writer.WriteLine(textData);
            writer.Close();
        }

1 Answer

0 votes
by (7.7k points)

Is there any log information?

by (180 points)

2022-01-26 12:39:22.216 1143-2348/? E/TaskPersister: File error accessing recents directory (directory doesn't exist?).

As if such a directory does not exist, but it works on pico 2

by (7.7k points)

Try adding the following attributes under the tag in the manifest file:

android:requestLegacyExternalStorage="true"

This is because neo 3 is based on android 10, and Android10.0 has changed the way files are stored, adding this property enables the old way of storing files.

by (180 points)

Yes. Add this string, but it not help for me. What solve my problem its change Unity version.

by (180 points)

But when I changed version of Unity. The application just completely freezes at some point. Returned the required version, the file is not saved or read again. Some vicious circle. Unity version 2020.3.25.
This property add on the manifest file android:requestLegacyExternalStorage="true"

by (55.5k points)

Dear Developer,
Could you please send your demo project to our email address? Please named the email by the title of this question. We will check it.
pico_devanswers@bytedance.com

...