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

If the destination file already exists and it is opened by another process, then you will see this error.

Solving method: Rename the destination file, or close the application that already opens the file.

查看更多
闹够了就滚
3楼-- · 2019-02-05 13:32

zipalign tool can't access to the source file, so you should verify path, file name, extension, permissions ...

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

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.

查看更多
该账号已被封号
5楼-- · 2019-02-05 13:34

I got this error because I had no write access to the target directory. Changing the permission accordingly resolved the problem.

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

I had the same problem with my zipalign command. Output path was correct but the folders did not exist which was provided in the output path and so i created the folders manually and then it all worked fine.

查看更多
叼着烟拽天下
7楼-- · 2019-02-05 13:36

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)
查看更多
登录 后发表回答