Can't import repackaged .apkg files

So from what I understand, a .apkg file is essentially a zip file. That means that I can access a .apkg file by renaming it to .zip, decompressing it and then able to see the media and collection sqlite3 database.

The problem is when I repackage the file. So if I compress the extracted folder (without any changes), I cant reimport it, the following error is there. This is compressing using the mac’s built in compressor as well as the same python zip file config in the anki code (zipfile.ZipFile(‘Python.apkg’, ‘w’, zipfile.ZIP_DEFLATED, allowZip64=True)". Please let me know why this is happening and how to resolve it.

If you compare the two zip files in a zip editor the problem should become apparent.

1 Like