Missing manifest.json when uploading Firefox Add-on to AMO
Asked Answered
O

7

9

I'm unable to upload my firefox extension using the form provided by mozilla. I'm constantly getting the error Your add-on failed validation with 2 errors. No install.rdf or manifest.json foundAdd-on missing manifest, which is very misleading because my application has a manifest.json.

The manifest.json looks like this:

{
"manifest_version": 2,
"version": 1.0,
"name": "my-extension-name",
"description": "Lorem ipsum dolor sit amet",
"background": {
   "scripts": ["js/background.js"]
},
"main": "popup.js",
"browser_action": {
  "default_icon": "img/icon_grey.png",
  "default_popup": "popup.html",
  "default_title": "loremipsum"
},
"engines": {
  "firefox": ">=38.0a1"
},
"permissions": [
  "activeTab",
  "tabs",
  "background",
  "http://*/*",
  "https://*/*",
  "notifications",
  "alarms",
  "storage",
  "webRequest",
  "webRequestBlocking",
  "clipboardRead"
]
}

What is missing for this to work?

Operetta answered 6/12, 2016 at 21:29 Comment(4)
Without access to the actual file you attempted to upload, we are not going to be able to determine what your problem is. All we can do is guess. Please provide somewhere from which we can download that file.Brunhild
You might not have noticed that I was able to solve the issue. Please find the accepted answer below.Operetta
I did see that you got past the issue that you had. I'm glad you did. The issue with this Question is that your Question does not include enough information to actually solve the problem (i.e. any random person would have to be psychic to be able to solve it, or just be guessing, like Andy tried). While the the steps you indicated in your answer resulted in you being able to upload to AMO, they are not required. Thus, your answer does not provide any additional information as to what your real problem was (i.e.What, in how you constructed your original submission, was incorrect).Brunhild
The assumption that the steps I provided in my answer are not required is false. Besides using web-ext the application that I eventually uploaded is identical to the application that I was previously unable to upload. I understand that the information I provided is very limited but as the problem was the manifest.json, which is provided and gives a lot of information, I can't see what else I could give you that might help. Also, originally I thought that my manifest.json might contain mistakes that I couldn't find but could be obvious for someone on stackoverflow.Operetta
O
1

As I have found a solution to my problem and would like to share it for future reference I answer my own question:

The issue at hand was that I did not use the web-ext command line tool to create the .zip / .xpi package. I was able to solve the problem by installing web-ext and using web-ext build to build the extension. The result of this operation is a .xpi file that contains the project which I was then able to upload to the AMO service. Note that the manifest.json in the newly created package is identical to the manifest.json I originally provided. However, in addition to the manifest.json a directory META-INF was created which contains a mozilla.mf, mozilla.rsa and mozilla.sf file.

This however, did not entirely solve my problem. After uploading the extension to AMO, it could not be installed and was said to be damaged. Apparently, which is what I read somewhere in the interwebz (and forgot the source), Mozilla opens the .zip / .xpi package that is uploaded to test it and since my package was not signed, Mozilla could not ensure its integrity and marked it as insecure (i.e. damaged).

In order to solve the second problem I had to sign the extension. This can be done using the following command:

web-ext sign --api-secret YOUR_API_SECTER --api-key YOUR_API_KEY

After this, I was able to upload and install the extension.

Operetta answered 13/12, 2016 at 11:10 Comment(0)
R
36

I was running into the same problem but all of these instructions didn't solve it. What i always did was to pack the whole folder, hence the manifest.json was not on the first level, when unpacked.

SOLUTION FOR ME

Select all files, instead of the folder, and then pack them as one .zip file and it should work. At least it did for me.

Here is a link to the MDN Documentation.

Reiterate answered 8/4, 2017 at 21:8 Comment(0)
J
6

The very simple answer to this is that its unable to find the manifest in your zip file. This is caused because when you take a file and zip it using the default compressor in windows it takes the file and throws it into a sub folder of the zip file you created...

before compressing

folderYouWantCompressed -FileInFolder.html -Manifest.json

after compressing it will look like this

nameOfZip.zip -folderYouWantCompressed -FileInFolder.html -Manifest.json

but what you want is

nameOfZip.zip -FileInFolder.html -Manifest.json

the reason Oliver Sauter answer works is because when you select all the files within the "folderYouWantCompressed" it compresses without the sub folder meaning you dont run into this problem and it has no problem finding the manifest file.

for what I can tell the "correct answer" seems to be signing the add-on itself and is able to get the manifest file properly, so it does work but just seems like a 3rd party way of doing it (I did not look into it too deeply)

Note: that I originally had my issue solved by looking at Oliver Sauter post I just wanted to make it clear for future people looking at this post.

Jairia answered 8/6, 2018 at 20:47 Comment(0)
S
2

When you open your addon package zip file, the manifest.json file should be visible to you in order to upload it on AMO.

In your case, it looks like when you open your package zip, there is a folder and inside that folder manifest.json is located.

Superstratum answered 7/12, 2016 at 13:46 Comment(2)
this is not the case.Operetta
Try changing firefox version to 49, in engines key set ">=49"Superstratum
O
1

As I have found a solution to my problem and would like to share it for future reference I answer my own question:

The issue at hand was that I did not use the web-ext command line tool to create the .zip / .xpi package. I was able to solve the problem by installing web-ext and using web-ext build to build the extension. The result of this operation is a .xpi file that contains the project which I was then able to upload to the AMO service. Note that the manifest.json in the newly created package is identical to the manifest.json I originally provided. However, in addition to the manifest.json a directory META-INF was created which contains a mozilla.mf, mozilla.rsa and mozilla.sf file.

This however, did not entirely solve my problem. After uploading the extension to AMO, it could not be installed and was said to be damaged. Apparently, which is what I read somewhere in the interwebz (and forgot the source), Mozilla opens the .zip / .xpi package that is uploaded to test it and since my package was not signed, Mozilla could not ensure its integrity and marked it as insecure (i.e. damaged).

In order to solve the second problem I had to sign the extension. This can be done using the following command:

web-ext sign --api-secret YOUR_API_SECTER --api-key YOUR_API_KEY

After this, I was able to upload and install the extension.

Operetta answered 13/12, 2016 at 11:10 Comment(0)
F
0

Got the same problem, the problem was thats the file name is case sensitive:

Manifest.jason -> error, no manifest found manifest.json -> susscessful

Flageolet answered 12/1, 2018 at 14:43 Comment(0)
W
0

my solution (in mac os):

zip a directory using zip in terminal command zip -r example.zip example instead of right-clicking files and clicking "Compress" in mac os

Windowshop answered 25/12, 2022 at 13:54 Comment(0)
A
0

Oliver Sauter is right. If you use mac or linux, zip command in terminal can solve the issue easily.

(I have to say the current mozilla site sucks but this worked like a charm for me)

cd myfolder
zip -r name.zip .
Assoil answered 17/10, 2023 at 14:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.