Closed leocencetti closed 2 months ago
I've been doing this with NextCloud and it does work. Nextcloud sometimes drops the offline availability and I have to open the app to get it to come to its senses, then switch back to NanoLedger for it to find it, but I have that trouble with the Android Nextcloud app in general. The NanoLedger side seems to work and I collect entries from a couple phones that way.
I've also been using it with nextcloud without issues. It seems like the content providers you've tried don't support appending to a file. This is annoying, but not impossible to fix. I can just do the append operation in the app and write the entire file. I assume that when syncing the entire file is pushed anyway, so this shouldn't result in any noticeable differences for the content providers that currently work.
I'll try to get to this issue sooner rather than later (this should only need a few lines of changes).
@leocencetti Any chance you'd be able to give this APK a try? You should just be able to install it above the one from f-droid.
@leocencetti Any chance you'd be able to give this APK a try? You should just be able to install it above the one from f-droid.
Hello @chvp, thanks for the quick reply! That seems to work! No error message and the file is updated online correctly.
I tested both Google Drive (the one I use primarily), OneDrive and kDrive: the first two work, the last one does not (without any error message, the transaction does not show up after saving).
I'll merge that PR and make a new release tomorrow. Not sure about kdrive. They do seem to have an open app on fdroid, so I'll try that out at some point and see if I can find something in the logs. Is kdrive a blocker for you or can I close this issue when #162 is merged?
Thanks! kDrive is a nice to have, but definitely not a blocker!
It seems like NanoLedger is unable to modify files that are synchronized with cloud storage providers (I've tried GDrive, OneDrive and others). The files can be successfully read, but not written to. Offline availability of the files seems to have no impact.
Reproduction steps
Expected behaviour
Writing to synchronized files succeeds
System information
App version: https://github.com/chvp/NanoLedger/releases/tag/v0.4.5 (and previous) Android version:
14
Error log
```bash java.io.FileNotFoundException: Unsupported mode: wa at android.database.DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel(DatabaseUtils.java:151) at android.content.ContentProviderProxy.openAssetFile(ContentProviderNative.java:737) at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1878) at android.content.ContentResolver.openOutputStream(ContentResolver.java:1576) at be.chvp.nanoledger.data.LedgerRepository.appendTo(LedgerRepository.kt:95) at be.chvp.nanoledger.ui.add.AddViewModel$append$1.invokeSuspend(AddViewModel.kt:142) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108) at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115) at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:103) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684) ```