ankidroid / Anki-Android

AnkiDroid: Anki flashcards on Android. Your secret trick to achieve superhuman information retention.
GNU General Public License v3.0
8.47k stars 2.2k forks source link

[BUG]: Cannot change AnkiDroid directory: directory wasn't valid #17149

Closed kik4444 closed 3 hours ago

kik4444 commented 3 hours ago

Checked for duplicates?

Does it also happen in the desktop version?

What are the steps to reproduce this bug?

Go to Settings -> Advanced -> AnkiDroid directory and change it to /storage/emulated/0/AnkiDroid. I get an error saying The path specified wasn't a valid directory. The directory does exist and I can Export my collection to it, meaning that AnkiDroid does have write access to it. I can access the directory through Termux too so I can know its path is /storage/emulated/0/AnkiDroid.

I want to change AnkiDroid's collection directory so I can sync it up with my PC with Syncthing. I can't access AnkiDroid's default directory in /storage/emulated/0/Android/data/com.ichi2.anki/files/AnkiDroid

Expected behaviour

The directory for AnkiDroid's collection should be changed to the new one.

Debug info

AnkiDroid Version = 2.18.4 (f867da96b8304edaebd0361326316bc7514f8cde)

Backend Version = 0.1.38-anki24.04.1 (24.04.1 ccd9ca1a8309b80bcb50ddc5d99c7ce63440bce9)

Android Version = 14 (SDK 34)

ProductFlavor = play

Manufacturer = Nothing

Model = A065

Hardware = qcom

Webview User Agent = Mozilla/5.0 (Linux; Android 14; A065 Build/UP1A.231005.007; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/128.0.6613.148 Mobile Safari/537.36

ACRA UUID = 9e472c2e-cc7c-4fd3-b791-a95c50d5c8dd

FSRS Enabled = false

Crash Reports Enabled = true

(Optional) Anything else you want to share?

I tried changing the directory to the target one while it's empty and while it contains my collection.anki2 and some other files. In both cases it didn't work.

Research

welcome[bot] commented 3 hours ago

Hello! 👋 Thanks for logging this issue. Please remember we are all volunteers here, so some patience may be required before we can get to the issue. Also remember that the fastest way to get resolution on an issue is to propose a change directly, https://github.com/ankidroid/Anki-Android/wiki/Contributing

kik4444 commented 3 hours ago

Sorry, I missed some pages like these two https://github.com/ankidroid/Anki-Android/issues/16365 https://github.com/ankidroid/Anki-Android/wiki/Full-Storage-Access

Switching to the fdroid version does ask me for full disk access now and I can change the collection directory like I wanted to.