google / modernstorage

ModernStorage is a group of libraries that provide an abstraction layer over storage on Android to simplify its interactions
https://google.github.io/modernstorage/
Apache License 2.0
1.24k stars 60 forks source link

Add filesystem writing example #42

Closed yrezgui closed 3 years ago

yrezgui commented 3 years ago
E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.google.modernstorage.sample, PID: 24988
    java.nio.channels.NonWritableChannelException
        at sun.nio.ch.FileChannelImpl.write(FileChannelImpl.java:239)
        at java.nio.channels.Channels.writeFullyImpl(Channels.java:79)
        at java.nio.channels.Channels.writeFully(Channels.java:102)
        at java.nio.channels.Channels.access$000(Channels.java:62)
        at java.nio.channels.Channels$1.write(Channels.java:175)
        at java.nio.file.Files.copy(Files.java:2909)
        at java.nio.file.Files.copy(Files.java:3027)
        at com.google.modernstorage.sample.filesystem.FileSystemViewModel$downloadAndSaveContent$1$1.invokeSuspend(FileSystemViewModel.kt:114)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:738)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
nic0lette commented 3 years ago

I think 3e39ef8 should have unblocked writing.