Anki-android: this is not a valid apkg file

Created on 30 Mar 2018  路  8Comments  路  Source: ankidroid/Anki-Android

Research

Enter an [ x ] character to confirm the points below:

[ ] I have read the support page and am reporting a bug or enhancement request specific to AnkiDroid

[ ] I have checked the manual and the FAQ and could not find a solution to my issue

[ ] I have searched for similar existing issues here and on the user forum

Reproduction Steps
  1. I exported a collection by ankidroid 2.8.3
  2. when i want to import it ( .apkg file ) i saw the following error
    3. this is not a valid apkg file
Expected Result

i want to import my exported collection succesfully

Actual Result

"this is not a valid apkg file" error

Debug info

AnkiDroid Version = 2.8.3

Android Version = 5.0.2

ACRA UUID = f033bf01-6f75-490d-89ab-3f910aa98c82

photo_2018-03-30_13-15-42

Most helpful comment

thank you so much...you,r my champion :)
it works properly ....but there are no my voice records (no matter )

i appreciate for your valuable time

All 8 comments

pleaes help me. i made a big collection and i dont want to lose it
appreciate

You indicated you have read the FAQ, did you try all the items from the lost cards area including looking for backups and restoring? Have you synced with ankiweb at all? I usually move to new phones by syncing up to ankiweb on the old phone then down on the new device. Finally if you try those things and there is still an issue it would help if you could share the collection with a file sharing service somewhere so others could examine it

unfortunately i did not sync my phone with ankiweb and only have this file. i spent about 6 month on this file. please check it and allow me to know what happend. this is my collection link (171 mb).
thank u so much

https://files.fm/u/saztqmgw

I still waiting for anybody can solve this problem. I appreciate

I was able to download the collection and inspect it.

Exported Anki collections are zip files, and my zip utilities indicated that the file was corrupt - specifically it looks like at some point while you were handling the file (copying it, etc) there was a partial transfer and the end of the file is missing?

So there may be missing data.

However, I was able to use the zip "forcefully fix" option ("-FF") to repair the zip enough to unpack it, then repack it and I was able to import it successfully into AnkiDroid in my emulator (version 2.9alpha19 - but should work for latest stable release)

The series of commands I used was this, on a MacOS laptop with OSX 10.13.3:

zip -FF collection.apkg --out collection.zipfix.apkg
mkdir TEMP && cd TEMP
unzip ../collection.zipfix.apkg
zip ../collection.zipfix.repack.apkg *

I'll try uploading the file shortly but you can experiment with those commands as well.

Ok, this was the result of the above commands if you don't have the tools to run it locally or just want to download it. Please let me know once you've fetched this file and I'll delete it, or if I don't hear back I will remove it in a couple days either way. Hope this helps

https://www.dropbox.com/s/eitpjh7skb7u7an/collection.zipfix.repack.apkg?dl=0

thank you so much...you,r my champion :)
it works properly ....but there are no my voice records (no matter )

i appreciate for your valuable time

Nice to see this kind of happily-ever-after story, thanks @mikehardy!

Was this page helpful?
0 / 5 - 0 ratings