Mac下压缩遇到的ZIP包非法问题
Mac下选中文件夹,右键选择压缩,生成的ZIP包在提交到Chrome商店时候是有报错。
There was a problem uploading your file. Please try again.
Invalid package. Please make sure it is a valid zip file and the file manifest.json is at the root directory of the zip package.


按照报错提示。
- ZIP包不合法。
- ZIP包根文件夹内没有manifest清单文件。
排查
手动解压问题包,查看是有manifest的,因此只可能是问题1了。Mac自带解压工具解压发现包是可以正常解压的,同时尝试使用其它压缩软件,比如Keka或者CLI ZIP命令发现是没有问题,因此确定是Mac下压缩工具存在差异。
利用jszip读取ZIP包内容,对比发现问题包中是多了个__MACOSX
,查询发现其作用如下。

解决办法
使用ZIP命令或者第三方压缩App,比如keka。
结论
推荐使用命令或其它压缩工具解决压缩问题。
至于本地可以正常解压,但Chrome应用商店上传就报错的,是否也说明Chrome侧有问题,这个目前我是提了工单,还在进一步沟通中。