[ Error: Invalid XPI ] And No Details?
I'm making a Firefox add-on and zipped it to an XPI file. I drag the file to Firefox and I click install. But it didn't work so I open the developer console. It shows an error:
WARN | Invalid XPI File WARN | Failed to download addon file:///Workspaces/-----/addon/quicklinkbar.xpi
Usually it's supposed to say WHY IT WAS INVALID. Is is because it's completely invalid it has no reason to say, or is it just some rare case?
I'm a beginner so maybe it was just a simple mistake.
Alterado por William Qin em
Solução escolhida
Could be the uppercase RDF in the http://www.w3.org/1999/02/22-RDF-syntax-ns#
<RDF xmlns="http://www.w3.org/1999/02/22-RDF-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">Ler esta resposta 👍 1
Todas as respostas (10)
You might have better luck with this question on an add-on developer-oriented forum. Perhaps one of the following:
Did you check the content of the file to make sure that the folder structure is correct if you compare it with a valid file in case you added the root folder or otherwise something had gone wrong?
You can also check for an unsupported compression algorithm and try a lower on no compression.
Since XPIs are ZIPs you can't do that with no compression. And I used another compression, cgzip and it is still invalid.
I added an image attached. Is that the right folder structure?
I don't think that it is correct.
The install.rdf file and the chrome.manifest file need to be in the root and not in the chrome or defaults directory.
See:
Sorry if I am reading the Mac OSX folder structure incorrectly, but ...
Is the install.rdf file in the /defaults/ folder? Same for the chrome.manifest file in the /chrome/ folder?
Alterado por the-edmeister em
Now I did it according to the Mozilla Doc. I put install.rdf and chrome.manifest in the root folder. Still won't work!
Are the install.rdf and chrome.manifest files still visible if you collapse all folders (chrome, defaults, skin)?
We would have to check the file to see what is wrong if you can't find it yourself. You can leave out the quicklinkbar.js file if you like to keep that confident.
Yes, both are visible. However the error says it's coming from the .rdf file on line 3. But line 3 is the doctype/rdf tag!
Attached 2 images.
Since It says the error is line 3 of install.rdf, here it is!
<?xml version="1.0"?> <RDF xmlns="http://www.w3.org/1999/02/22-RDF-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <Description about="urn:mozilla:install-manifest"> <em:id>[email protected]</em:id> <em:version>1.0</em:version> <em:type>2</em:type> <em:targetApplication> <Description> <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <em:minVersion>4.0.*</em:minVersion> <em:maxVersion>33.*</em:maxVersion> </Description> </em:targetApplication> <em:name>QuickLink Toolbar</em:name> <em:description> Sometimes you want to visit a common website, but you have to get it from bookmarks or type it in the addressbar. With this add-on you have all the popular sites 1 click away! </em:description> <em:creator>William Qin</em:creator> <em:homepageURL>http://narawagames.appspot.com</em:homepageURL> </Description> </RDF>
Alterado por cor-el em
Solução escolhida
Could be the uppercase RDF in the http://www.w3.org/1999/02/22-RDF-syntax-ns#
<RDF xmlns="http://www.w3.org/1999/02/22-RDF-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">