handydevcom / financier

GNU General Public License v2.0
29 stars 12 forks source link

[Andriod 11] Local backup/restore fails #6

Closed powerarmorpatch closed 3 years ago

powerarmorpatch commented 3 years ago

On Android 11 I was unable to backup/restore the *.backup from internal storage, though I was able to restore the same file from Dropbox integration.

Backup folder location is default: /storage/emulated/0/financier

The reason I believe is because Financier asks for "media and photos access" permission: Screenshot_20210222-233901

While other apps request access to all files: Screenshot_20210222-233926

Found some info about new permission policy here.

Excerpt from logcat:

02-22 23:44:07.361  4605  3279 E MediaProvider: Creating a non-default top level directory or deleting an existing one is not allowed!
02-22 23:44:07.363  4605  6376 E MediaProvider: Creating a non-default top level directory or deleting an existing one is not allowed!
02-22 23:44:07.371 11032 13110 E Financier: Unable to do import/export
02-22 23:44:07.371 11032 13110 E Financier: java.io.FileNotFoundException: /storage/emulated/0/financier/20210222_234407_364.backup: open failed: ENOENT (No such file or directory)
02-22 23:44:07.371 11032 13110 E Financier:     at libcore.io.IoBridge.open(IoBridge.java:492)
02-22 23:44:07.371 11032 13110 E Financier:     at java.io.FileOutputStream.<init>(FileOutputStream.java:236)
02-22 23:44:07.371 11032 13110 E Financier:     at java.io.FileOutputStream.<init>(FileOutputStream.java:186)
02-22 23:44:07.371 11032 13110 E Financier:     at com.handydev.financier.export.Export.export(Export.java:57)
02-22 23:44:07.371 11032 13110 E Financier:     at com.handydev.financier.export.BackupExportTask.work(BackupExportTask.java:23)
02-22 23:44:07.371 11032 13110 E Financier:     at com.handydev.financier.export.ImportExportAsyncTask.doInBackground(ImportExportAsyncTask.java:57)
02-22 23:44:07.371 11032 13110 E Financier:     at com.handydev.financier.export.ImportExportAsyncTask.doInBackground(ImportExportAsyncTask.java:31)
02-22 23:44:07.371 11032 13110 E Financier:     at android.os.AsyncTask$3.call(AsyncTask.java:394)
02-22 23:44:07.371 11032 13110 E Financier:     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
02-22 23:44:07.371 11032 13110 E Financier:     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
02-22 23:44:07.371 11032 13110 E Financier:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
02-22 23:44:07.371 11032 13110 E Financier:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
02-22 23:44:07.371 11032 13110 E Financier:     at java.lang.Thread.run(Thread.java:923)
02-22 23:44:07.371 11032 13110 E Financier: Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
02-22 23:44:07.371 11032 13110 E Financier:     at libcore.io.Linux.open(Native Method)
02-22 23:44:07.371 11032 13110 E Financier:     at libcore.io.ForwardingOs.open(ForwardingOs.java:166)
02-22 23:44:07.371 11032 13110 E Financier:     at libcore.io.BlockGuardOs.open(BlockGuardOs.java:254)
02-22 23:44:07.371 11032 13110 E Financier:     at libcore.io.ForwardingOs.open(ForwardingOs.java:166)
02-22 23:44:07.371 11032 13110 E Financier:     at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:7547)
02-22 23:44:07.371 11032 13110 E Financier:     at libcore.io.IoBridge.open(IoBridge.java:478)
02-22 23:44:07.371 11032 13110 E Financier:     ... 12 more
mbarashkov commented 3 years ago

Fixed