Discrepancy in missing files between Ankidroid and Anki desktop

Pictures attached
Anki desktop: 25.05b2
Ankidroid: 2.21apha15 (same number given on s22 ultra and redmi note 10 pro)


Already tried force sync but it does not resolve the issue

Forcing a one-way sync does not affect media sync, so there’s no need for that. You have 18 GBs of media in your AnkiWeb account. It’s going to take some time and several tries for all of that to finish syncing to your Android device (and hopefully you have the space for that). Media files may take time to sync - Anki FAQs

As you can see in your desktop Check Media – you’ve got one file that won’t ever sync, so you might want to do something about that too.

2 Likes

I have been using Ankidroid on this phone for quite a few years and have synced many times. I rarely check media on phone but this time I did and the missing files came up.
I think there should be a force sync media option as well where it verifies files present on ankiweb and local storage, skip files that are present/common and sync the absent ones.

You can force it, just not with a one-way sync. If you log out of sync in your Settings/Preferences, and then click sync to log in again, your media will be rescanned. Then, keep syncing until your Check Media results match.

1 Like

I tried this but no change
For some odd reason the sync jumps when in 60 thousands straight into 150k range

Pc media folder shows that it contains 74819 items

Ankidroid pics




Is it possible it is some kind of bug in Ankidroid because i took screenshots of missing files and asked chatgpt to count lines in the pics, the number of missing files was close to what pc Anki was giving

Are you saying that AnkiDroid is telling you that you’re missing 1194 files – and then showing you a list of only 196 filenames?

Yes it seems to be the case

That is very unusual, but let’s take it from the top again –

  • Do you have any actual notes where you expect to see attached media and it doesn’t show up on your cards? Or is this something you’re trying to solve just because the counts are different?
  • Run Check Media and then Check Database again. Any change (on either device)?
  • Have you looked at those notes that refer to missing media? On your desktop, click “Tag Missing” and then search tag:missing-media in the Browse window.
    • Do you get 196 notes or 1194 notes (switch to Notes mode)?
    • Rename that tag to “missing-media-PC” and sync. Then sync your AnkiDroid and use Check Media to Tag Missing again. When you search tag:missing-media on AnkiDroid, do you get the same number of notes as on desktop?
    • Ideally, you should have a single set of notes that are now tagged with both “missing-media” and “missing-media-PC” Can you fix these notes – by adding the media back or removing the reference to the media?
1 Like

I did and the number of notes tagged with missing media comes out to be same on both pc and Ankidroid. The number of notes is 1189. Also same notes were tagged by both pc and Ankidroid.
But going through the tagged notes, apparently those notes have also been tagged with no missing media such as the below example


Is this alright or shouldn’t be the case?

It appears that some files being shown as missing are in fact present, an example




Ah, I forgot to comment here. So this is a bug with AnkiDroid using HTML names for special symbols etc. instead of the actual filename. I think it should get fixed in the near future as I reported the issue before. Let me know if I got something wrong.

For now, you can simply ignore this or use simple names for your files.

2 Likes

But the anki app on pc also tagged the same notes with missing media, does this bug also exist in the pc version of anki?

Not to my knowledge.

I’m glad that the files aren’t actually missing – and thanks for sharing such a clear example!

Part of what you’re seeing is expected –

If your media filenames contain spaces or other special characters such as percentage signs, the way the filenames appear in the HTML editor will differ from the way the filenames appear on disk. For example, a file called hello 100%.jpg will appear as hello%20100%25.jpg in the HTML editor. – Media - Anki Manual

So, your file shows up with the %20symbols in the HTML of your note field, but exists in your collection media with actual spaces. But Anki is used to that, and it should understand that the file isn’t missing.

  • Can you check that the same file name with spaces doesn’t show up in Check Media as an “unused” file?
  • Have you run Tools > Check Database lately? Try that. It’s possible that something in the database needs to be re-indexed (or whatever).
1 Like

No, they do not

Yes, but it did not improve anything.

For now I have changed filenames with space to _ and this has resolved the issue for media files present being marked as missing.

2 Likes

Btw any plans to resolve this in a future anki release?

To resolve the documented difference between the filenames – which is ordinarily not an problem and no one even notices? Or to resolve this issue with the files showing up incorrectly as “missing” – that you’ve just reported and the devs haven’t had a chance to assess yet? :wink:

I think you stumbled upon this issue (just linking to it):

I don’t think so as I never use ankidroid to clear up unused media. I use that feature in anki pc and sync. I use Ankidroid only for doing cards when I am not near my laptop.

This one. Lets hope devs note it and resolve when more important tasks have been done.
Btw I dont think this is a high priority issue, just a nuance and triggers ones ocd tendencies :joy::joy::joy: