Error while running zipalign

2019-02-05 13:05发布

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 the latest update is installed and SDK tools also up to date.

17条回答
再贱就再见
2楼-- · 2019-02-05 13:36

In my case, on Linux (Mint), I had to set the execution permission of zipalign manually and then it worked like a charm.

查看更多
贪生不怕死
3楼-- · 2019-02-05 13:42

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.

查看更多
放我归山
4楼-- · 2019-02-05 13:42

In my case the problem was utf-8 named folder. I changed it into English and worked. I am using Windows 8 x64 Enterprise edition.

查看更多
爱情/是我丢掉的垃圾
5楼-- · 2019-02-05 13:44

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.

查看更多
别忘想泡老子
6楼-- · 2019-02-05 13:44

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

查看更多
登录 后发表回答