New /storage/emulated/0 is an invalid directory


GTMoraes

Members
Dec 30, 2018
79
30
Hey,

Several apps are crashing and complaining that they can't save their files and/or access files they just created.

The logs are very clear:
Code:
java.io.FileNotFoundException: /storage/emulated/0/Comprovante.png: open failed: EACCES (Permission denied)
    at libcore.io.IoBridge.open(IoBridge.java:496)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:235)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:186)
    at br.com.neon.ui.factory.ShareReceiptViewFactory$write$2.invokeSuspend(ShareReceiptViewFactory.kt:2)
    at kotlin.t.j.a.a.resumeWith(ContinuationImpl.kt:3)
    at kotlinx.coroutines.o0.run(Dispatched.kt:13)
    at kotlinx.coroutines.g2.a.a(CoroutineScheduler.kt:32)
    at kotlinx.coroutines.g2.a.a(CoroutineScheduler.kt:4)
    at kotlinx.coroutines.g2.a$b.run(CoroutineScheduler.kt:9)
Caused by: android.system.ErrnoException: open failed: EACCES (Permission denied)
    at libcore.io.Linux.open(Native Method)
    at libcore.io.ForwardingOs.open(ForwardingOs.java:167)
    at libcore.io.BlockGuardOs.open(BlockGuardOs.java:252)
    at libcore.io.ForwardingOs.open(ForwardingOs.java:167)
    at android.app.ActivityThread$AndroidOs.open(Unknown Source:15)
    at libcore.io.IoBridge.open(IoBridge.java:482)
    ... 8 more

The path is, for some reason, broken or otherwise unaccessible

Trying to manually access the directory with Solid Explorer renders an error message saying the directory was not found

Same thing happens with the /sdcard and /mnt/sdcard path, which seems to be a symlink to the /storage/emulated/0

But, the only working directory that correctly points to the internal storage is:
/storage/self/primary
Which also seems to be a symlink to /storage/emulated/0.

Something is off, not sure what. Maybe permissions or something else.

I've clean flashed and even tried a full system format, to no avail.

I think that's a bug, and I'd like to know if there's a simple solution to that. Otherwise I'll just wait for confirmation and a fix in a future build

Thanks!