Search Unity

Bug Unable to access the device memory

Discussion in 'Android' started by xtdiwd, Nov 21, 2021.

  1. xtdiwd

    xtdiwd

    Joined:
    Jul 25, 2020
    Posts:
    135
    I've come to the conclusion that from Android 10 onwards, even knowing the path to the app's external memory (but internal to the device, not even to the SD), it's impossible to access write, and probably read.
    System.IO.File.CreateText that worked at least until Android 8 returns an exception.
     
  2. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    836
  3. xtdiwd

    xtdiwd

    Joined:
    Jul 25, 2020
    Posts:
    135
    @JuliusM, I read the article... and the comments about the video on the bottom
    I agree!
    I tried creating a custom manifest and adding permissions as shown in https://stackoverflow.com/a/64665699 (WRITE_EXTERNAL_STORAGE and READ_EXTERNAL_STORAGE).
    I used the function https://stackoverflow.com/a/50688343/17464387
    but (after correcting the syntax) it didn't work. What did I do wrong?


    Is there any hope that in an upcoming Unity update they will automatically add the necessary permissions to the manifest and the ability to read and write files in any location? If I create a text editor app I need it!