Import issue with apkg file

Hi, I downloaded an apkg file of an Anki set my friend sent me, but when I try to import it this error comes up ‘500: invalid Zip archive: Invalid CDFH offset in EOCD’. I’ve tried searching for what this means but nothing seems to come up. I also tried the collection2.file method but it didn’t seem to work. Does anyone have any suggestions on what the issue is and how I can fix it?

Thanks!

apkg — file extension. Change it to “zip.” Next, test this archive with an archiver; there might even be one online. Sometimes archivers can partially recover files.

That seems to have something to do with the structure of the zip file [see: Google Search], but I haven’t seen that error before in Anki. Did your friend use Anki to export it, or some other tool? Some tools claim to make APKG files, but don’t do it correctly.

You could try –

  • Download it again – in case it was an issue with transmitting the file.
  • Have your friend create a fresh export of the deck – using a current version of Anki, with add-ons disabled [see: safe mode], including media, but without scheduling information or deck presets. You can also use safe mode when you import the deck.

I tried this with an online archiver and it gave me a whole lot of files for every flashcard it seems. What should I do now?

they gave it to me through a google drive, but they did export it from Anki. Would downloading it from google drive have caused an issue?

It’s possible. The error came from somewhere. Did you try the other things I suggested?

Did you download the file from Google Drive to your computer first, and then import it into Anki? Or did you try to import it from Google Drive directly (by drag-drop, or another means)?

Trying to manually reconstruct the database/package using tools outside of Anki seems like a last resort. There’s no point in wasting time on that when you have other options.

If everything opens online and doesn’t return any errors, then the archive was definitely packed with the wrong program. I’m using Windows, and WinRar says it needs version “1.0 / Store Unix” to unpack. If the archiver detects everything, it should correctly assemble the archive after unpacking. But if there are errors, especially in the “collection” file, then things are bad. This file is important because it’s essentially an “sqllite” database containing all the card information, excluding any files located nearby. Sometimes, files that are more important than the actual information are saved there.
Therefore, if you’re not very knowledgeable about this, it’s easier to ask a friend to save the deck again as an “apkg” file. If there are errors, there’s a good chance something on their drive is already corrupted, possibly even the Anki program itself. Then you’ll need to figure out why this is happening. Another option is to make the deck public and share it with you, and then they can delete it.

Yep, I’ve tried your suggestions but nothing seems to be working, so I guess I’ll have to give up on this Anki set :frowning: Thank you for your advice!

1 Like

Yeah, my friend agrees that there just must be something wrong with the file/drive, so I’ve sent your advice to them to see if they can work it out, but for now ig there isn’t much I can do anymore as I’m not very experienced with Anki. Thanks again for your advice!