Chrome Extension - Invalid Package. Details:Can

2019-04-22 22:07发布

I worked on a chrome extension and uploaded it to chrome webstore and everything went well, I installed it on my Mac and on my Ubuntu machines in chrome it worked fine and installed. But when I try it on Windows machines, after download it popups a error message saying "Invalid Package, Can't unzip the extension".

Can any one tell me why or what might be the cause for this OS specific issue. Does it have anything to do with the permission or anything with respective folder name or content? The folder name or the extension name don't have any special characters and the previous version was fine.

Thanks in advance.

7条回答
三岁会撩人
2楼-- · 2019-04-22 22:11

I had a similar problem. My solution was:

  1. unzip the CRX to a directory...lets say called freddy123

  2. Rename "_manifest" to "manifest"..i.e remove the underscore.

  3. Chrome->settings->More Tools->Extensions (Check Develop Mode Check box)
  4. Load Unpacked extension (select freddy123 directory)

This worked for me.

查看更多
▲ chillily
3楼-- · 2019-04-22 22:14

I had the same problem but it was rejecting it because either the file was too big or the paths were too long (Windows...), which was because I accidentally included my entire node_modules directory in the .crx file.

查看更多
SAY GOODBYE
4楼-- · 2019-04-22 22:18

So the trick it to compress all the files within the folder not the folder itself.

NOTE: If it's saved in Google Drive (local syncing) this well mess it up too. Drive attaches little icons to folders that show up as unknown.

So remake the folder outside of Google Drive. That's what was messing mine up after the "only compress inside of folder" fix.

查看更多
Bombasti
5楼-- · 2019-04-22 22:26

Another cause of this problem (Error: could not unzip extension) might be that you include the root directory in your zip. You should zip all files in the same level of manifest.json.

Example

-yourappfolder
   |_manifest.js
   |_popup.html

In this case you should zip only manifest.js and popup.html, instead of zip the entire directory yourappfolder.

In other words, in your zip file you should NOT see the yourappfolder directory.

查看更多
The star\"
6楼-- · 2019-04-22 22:30

I had the same problem but the reason was different.

I found that there is an image which has a name that is too long. When I replaced the name with a shorter one and built new package, it installed successfully.

I hope this helps anyone may facing the same problem.

查看更多
Anthone
7楼-- · 2019-04-22 22:32

A quick Google only turned up one possibly useful result but I wasn't sure if it would help.

Is that error message exactly what you see (i.e. word for word)? I couldn't find it in the code.

I may be wrong but I think this could be the code responsible for the error. Unfortunately, the zip::Unzip call can potentially fail for a number of reasons and only provides more details in the logs. I'm guessing such logs output to this location (Windows XP);

%USERPROFILE%\Local Settings\Application Data\Google\Chrome\Application\debug.log

None of this information may be useful to you but I thought I'd show you my investigation :)

Have you tried to install the extension again and do you have administration rights (not sure if this would have an affect here)?

查看更多
登录 后发表回答