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 Updat
If your pre-align APK is larger than 2GB, it will also cause this issue. Tested with build-tools 23.0.1 on Windows 10 machine.
zipalign
tool can't access to the source file, so you should verify path, file name, extension, permissions ...
I had to provide the full path for the unsigned APK file: platforms/android/build/outputs/apk/android-release-output.apk
I had to run cmd from project folder where the
C:\Users\User\Documents\phone app\7\proj7\platforms\android\build\outputs\apkandroid-release-unsigned.apk is located and enter this in cmd C:\Users\User\AppData\Local\Android\Sdk\build-tools\26.0.0\zipalign -v 4 android-release-unsigned.apk myApp-signed.apk
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 4 “c:\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.
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.