d4rken-org / sdmaid

SD Maid is an Android app that helps you manage files and apps.
https://play.google.com/store/apps/details?id=eu.thedarken.sdm
1.53k stars 753 forks source link

Can't copy, move or create things on secondary storage via SAF #1682

Closed d4rken closed 6 years ago

d4rken commented 6 years ago
05-09 20:50:50.405 14939-15035/eu.thedarken.sdm W/DocumentFile: Failed query: java.lang.IllegalArgumentException: Failed to determine if 19F6-2209:Android/test is child of 19F6-2209:: java.io.FileNotFoundException: Missing file for 19F6-2209:Android/test at /storage/19F6-2209/Android/test
05-09 20:50:50.410 14939-15035/eu.thedarken.sdm W/DocumentsContract: Failed to create document
    java.lang.IllegalStateException: Failed to mkdir /storage/19F6-2209/Android/test
        at android.os.Parcel.createException(Parcel.java:1950)
        at android.os.Parcel.readException(Parcel.java:1910)
        at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:183)
        at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:135)
        at android.content.ContentProviderProxy.call(ContentProviderNative.java:651)
        at android.content.ContentProviderClient.call(ContentProviderClient.java:492)
        at android.provider.DocumentsContract.createDocument(DocumentsContract.java:1171)
        at android.provider.DocumentsContract.createDocument(DocumentsContract.java:1153)
        at android.support.v4.provider.TreeDocumentFile.createFile(TreeDocumentFile.java:49)
        at android.support.v4.provider.TreeDocumentFile.createDirectory(TreeDocumentFile.java:58)
        at eu.thedarken.sdm.tools.io.saf.SAFIO.create(SAFIO.java:211)
        at eu.thedarken.sdm.tools.io.SmartIO.create(SmartIO.java:198)
        at eu.thedarken.sdm.tools.io.SmartCreateTask$Builder.through(SmartCreateTask.java:75)
        at eu.thedarken.sdm.explorer.core.modules.mk.MkModule.process(MkModule.java:39)
        at eu.thedarken.sdm.explorer.core.modules.mk.MkModule.process(MkModule.java:18)
        at eu.thedarken.sdm.explorer.core.ExplorerWorker.onNewTask(ExplorerWorker.java:86)
        at eu.thedarken.sdm.explorer.core.ExplorerWorker.onNewTask(ExplorerWorker.java:51)
        at eu.thedarken.sdm.main.core.worker.AbstractWorker.process(AbstractWorker.java:252)
        at eu.thedarken.sdm.main.core.worker.WorkerHub$Processor.run(WorkerHub.java:206)
        at eu.thedarken.sdm.main.core.ThreadOverlord.lambda$postTask$1$ThreadOverlord(ThreadOverlord.java:166)
        at eu.thedarken.sdm.main.core.ThreadOverlord$$Lambda$1.run(Unknown Source:4)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at eu.thedarken.sdm.main.core.SDMThreadFactory.lambda$newThread$0$SDMThreadFactory(SDMThreadFactory.java:52)
        at eu.thedarken.sdm.main.core.SDMThreadFactory$$Lambda$0.run(Unknown Source:4)
        at java.lang.Thread.run(Thread.java:764)
05-09 20:50:50.412 14939-15035/eu.thedarken.sdm E/SDM:WorkerHub:Processor:ExplorerWorker: Exception during task processing!
d4rken commented 6 years ago

Currently it looks like a bug in Android P: https://issuetracker.google.com/issues/79481451

d4rken commented 6 years ago
05-09 21:38:05.380 14740-15465/? E/DatabaseUtils: Writing exception to parcel
    java.lang.IllegalStateException: Failed to mkdir /storage/19F6-2209/MyTestDir
        at com.android.internal.content.FileSystemProvider.createDocument(FileSystemProvider.java:185)
        at android.provider.DocumentsProvider.callUnchecked(DocumentsProvider.java:1005)
        at android.provider.DocumentsProvider.call(DocumentsProvider.java:951)
        at com.android.externalstorage.ExternalStorageProvider.call(ExternalStorageProvider.java:568)
        at android.content.ContentProvider$Transport.call(ContentProvider.java:401)
        at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:272)
        at android.os.Binder.execTransact(Binder.java:731)
05-09 21:38:05.404 16526-16583/eu.thedarken.sdm W/DocumentsContract: Failed to create document
    java.lang.IllegalStateException: Failed to mkdir /storage/19F6-2209/MyTestDir
        at android.os.Parcel.createException(Parcel.java:1950)
        at android.os.Parcel.readException(Parcel.java:1910)
        at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:183)
        at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:135)
        at android.content.ContentProviderProxy.call(ContentProviderNative.java:651)
        at android.content.ContentProviderClient.call(ContentProviderClient.java:492)
        at android.provider.DocumentsContract.createDocument(DocumentsContract.java:1171)
        at android.provider.DocumentsContract.createDocument(DocumentsContract.java:1153)
        at android.support.v4.provider.TreeDocumentFile.createFile(TreeDocumentFile.java:49)
        at android.support.v4.provider.TreeDocumentFile.createDirectory(TreeDocumentFile.java:58)
        at eu.thedarken.sdm.tools.io.saf.SAFIO.create(SAFIO.java:199)
        at eu.thedarken.sdm.tools.io.SmartIO.create(SmartIO.java:198)
        at eu.thedarken.sdm.tools.io.SmartCreateTask$Builder.through(SmartCreateTask.java:75)
        at eu.thedarken.sdm.explorer.core.modules.mk.MkModule.process(MkModule.java:41)
        at eu.thedarken.sdm.explorer.core.modules.mk.MkModule.process(MkModule.java:18)
        at eu.thedarken.sdm.explorer.core.ExplorerWorker.onNewTask(ExplorerWorker.java:86)
        at eu.thedarken.sdm.explorer.core.ExplorerWorker.onNewTask(ExplorerWorker.java:51)
        at eu.thedarken.sdm.main.core.worker.AbstractWorker.process(AbstractWorker.java:252)
        at eu.thedarken.sdm.main.core.worker.WorkerHub$Processor.run(WorkerHub.java:206)
        at eu.thedarken.sdm.main.core.ThreadOverlord.lambda$postTask$1$ThreadOverlord(ThreadOverlord.java:166)
        at eu.thedarken.sdm.main.core.ThreadOverlord$$Lambda$1.run(Unknown Source:4)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at eu.thedarken.sdm.main.core.SDMThreadFactory.lambda$newThread$0$SDMThreadFactory(SDMThreadFactory.java:52)
        at eu.thedarken.sdm.main.core.SDMThreadFactory$$Lambda$0.run(Unknown Source:4)
        at java.lang.Thread.run(Thread.java:764)
d4rken commented 6 years ago

Should be fixed with the next Android P release.

https://issuetracker.google.com/issues/79481451

d4rken commented 6 years ago

Fixed as of PPP3.