Chrome Extension - Invalid Package. Details:Can't unzip the extension

30,228

Solution 1

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.

Solution 2

This is because there a file inside the package with a Windows invalid character in name or there a corrupted file. In my case I've tried to download the CouponsHelper extension and this error was displayed too.

I downloaded the CRX file manually and opened it with 7Zip. In the folder had a file named Icon. When I try to extract using 7Zip an error occurs too.

Note on the screenshot that there an invalid char in Icon file and that it is zero sized (possibly corrupted).

Screenshot of 7Zip

Solution 3

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.

Solution 4

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.

Share:
30,228
Srikanth Rayabhagi
Author by

Srikanth Rayabhagi

Updated on July 22, 2022

Comments

  • Srikanth Rayabhagi
    Srikanth Rayabhagi almost 2 years

    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.

  • Tyler Liu
    Tyler Liu about 11 years
    Works for me! Thank you very much!
  • Mohd Anas
    Mohd Anas about 8 years
    I tried doing the same but getting this {"error_code":"PKG_INVALID_ZIP","error_detail":"Files outside directory with manifest Chrome/1.1.1/(Directory Structure) are not allowed: Chrome/."}
  • Brandon
    Brandon over 7 years
    I've experience this problem too. Windows has a maximum file path length of 260 characters, and for most people their extensions are getting installed into an already long path name like "C:\Document and Settings\User Fullname\Application Data\Google\Chrome", so that eats up a lot of the 260 characters.
  • Ravi Parekh
    Ravi Parekh over 6 years
    recent days, files is not there.