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:21

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

查看更多
Luminary・发光体
3楼-- · 2019-02-05 13:24

Adding on my solution:

My problem was that my assets folder was too large, and must have been messing with the zipping somehow. I had to remove files in the asset folder (or add them to _pre_production).

查看更多
我想做一个坏孩纸
4楼-- · 2019-02-05 13:25

For mac

Because the result of encoding does not match you must do this:

  1. open eclipse.ini
  2. add -Dfile.encoding=utf-8
查看更多
Ridiculous、
5楼-- · 2019-02-05 13:26

This issue occurred for me when I had my project's bin folder open in Windows Explorer.

I then tried to delete my old apk file (which the Export tool was unsuccessfully trying to overwrite), but I couldn't do that as I didn't have the necessary permission or because some other process had a lock on the file.

The solution was to restart my computer which released the lock on the apk file. Eclipse's Export tool then worked fine.

Update Could not delete the old apk file in Windows Explorer or in Command window (even when I opened it with Admin rights), but I could delete the apk when viewing it in my FileZilla FTP client application. Obviously, this is much more convenient than restarting the computer.

查看更多
何必那么认真
6楼-- · 2019-02-05 13:28

Check the space available on the destination disk. I got the same error because my disk was full :-)

查看更多
甜甜的少女心
7楼-- · 2019-02-05 13:31

Sometimes a simple \ instead of a / in the destination file path can lead to this. Double check your multiplatform ant files!

查看更多
登录 后发表回答