Skip to content Skip to sidebar Skip to footer

Error While Running Zipalign

I got this error when trying to export a signed apk in Eclipse Error while running zipalign: Unable to open as zip archive I have run the Help->Check for Updates to make sure

Solution 1:

I was getting the same error message. Drove me crazy until i found that my destination path was invalid.

Zipalign will give you that error even if the apk is perfectly valid, but

  • the path to the apk is invalid
  • the destination is invalid or does not exists
  • the permissions are invalid (apk is locked by other program)

Solution 2:

I had this same problem and yes, it was because the tool could not recognize the path. I was using the wrong slash because I got bad advice from a developer blog.

Sample line command if the file "origin.apk" is in a folder called “storage” in the C directory:

zipalign -f -v 4c:\storage\origin.apk” “c:\storage\done.apk”

Make sure you use the slash above the enter key...a lot of the "examples" I have seen use the one by the shift key and that will not work. This will take the apk called “origin.apk” and zipalign it and then save it to the same directory as the file “done.apk”.

Maybe this is just on Vista, I dont know. I am using Windows Vista 32-bit.


Solution 3:

In my case, I ran the command from the directory where the unsigned apk was and it ran perfectly.

cd /platforms/android/build/outputs/apk
zipalign -v 4 android-release-unsigned.apk signed.apk 

This way, I didn't need to worry about specifying the directory.

ps: I did this on ubuntu.


Solution 4:

I removed the apk file in the Deploy directory and the export worked fine then.


Solution 5:

I had to provide the full path for the unsigned APK file: platforms/android/build/outputs/apk/android-release-output.apk


Post a Comment for "Error While Running Zipalign"