Closed Bug 762648 Opened 12 years ago Closed 12 years ago

sdk-generated xpi fails to install on Google N1

Categories

(Add-on SDK Graveyard :: General, defect, P3)

x86_64
Linux
defect

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: konstantin.sobolev, Assigned: canuckistani)

References

Details

Attachments

(6 files)

127.97 KB, application/octet-stream
Details
3.09 KB, application/octet-stream
Details
4.46 KB, text/plain
Details
265 bytes, text/plain
Details
1.79 KB, application/octet-stream
Details
824 bytes, application/octet-stream
Details
Attached file test.xpi
I'm having troubles installing .xpi that I built using sdk for firefox mobile (native UI) on my Google Nexus One.
It works when I run it using "cfx run -a fennec-on-device ..." command, but "cfx xpi --force-mobile" builds an .xpi that fails to install.

Steps:
==============================================================================
(addon-sdk-1.7)(U)ksobolev@ksobolev-ld:~/workspace/fire$ mkdir test
(addon-sdk-1.7)(U)ksobolev@ksobolev-ld:~/workspace/fire$ cd test
(addon-sdk-1.7)(U)ksobolev@ksobolev-ld:~/workspace/fire/test$ cfx init
* lib directory created
* data directory created
* test directory created
* doc directory created
* README.md written
* package.json written
* test/test-main.js written
* lib/main.js written
* doc/main.md written

Your sample add-on is now ready.
Do "cfx test" to test it and "cfx run" to try it.  Have fun!

(addon-sdk-1.7)(U)ksobolev@ksobolev-ld:~/workspace/fire/test$ vim lib/main.js
(addon-sdk-1.7)(U)ksobolev@ksobolev-ld:~/workspace/fire/test$ cat lib/main.js
var pageMod = require("page-mod");
pageMod.PageMod({
    include: "*",
    contentScript: 'window.alert("test OK");'
});
console.log("The add-on is running.");

(addon-sdk-1.7)(U)ksobolev@ksobolev-ld:~/workspace/fire/test$ cfx xpi --force-mobile
No 'id' in package.json: creating a new ID for you.
package.json modified: please re-run 'cfx xpi'
(addon-sdk-1.7)(U)ksobolev@ksobolev-ld:~/workspace/fire/test$ cfx xpi --force-mobile
Exporting extension to test.xpi.

# THIS WORKS
(addon-sdk-1.7)(U)ksobolev@ksobolev-ld:~/workspace/fire/test$ cfx run -a fennec-on-device -b /home/ksobolev/android-sdk-linux_x86/platform-tools/adb --mobile-app firefox_beta --force-mobile

(addon-sdk-1.7)(U)ksobolev@ksobolev-ld:~/workspace/fire/test$ /home/ksobolev/android-sdk-linux_x86/platform-tools/adb push test.xpi /mnt/sdcard 977 KB/s (131046 bytes in 0.130s)
# Then install in using file:///mnt/sdcard/test.xpi in FF mobile
==============================================================================

Here's what pops up in logcat during installation:
==============================================================================
E/GeckoConsole(27641): [JavaScript Warning: "WARN addons.xpi: Error loading bootstrap.js for jid1-KNiUQWo8BpIY5w@jetpack: Error opening input stream (invalid filename?)"]
E/GeckoConsole(27641): [JavaScript Warning: "WARN addons.xpi: Add-on jid1-KNiUQWo8BpIY5w@jetpack is missing bootstrap method install" {file: "resource://gre/modules/XPIProvider.jsm" line: 3637}]
I/GeckoApp(27641): Got message: Toast:Show
E/GeckoConsole(27641): [JavaScript Warning: "WARN addons.xpi: Add-on jid1-KNiUQWo8BpIY5w@jetpack is missing bootstrap method startup" {file: "resource://gre/modules/XPIProvider.jsm" line: 3637}]
==============================================================================

as a result plugin is listed among installed plugins but it doesn't work.

SDK 1.7, Firefox 14 beta, N1 with stock ROM. test.xpi attached

see also: https://forums.mozilla.org/addons/viewtopic.php?f=27&t=10753
The addon itself is generating 13.0a1 as the max version while you are using 14 beta.  This is why it's not loading correctly.  I would say that this is a bug in the SDK ... they need to update the max version.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Product: Fennec Native → Add-on SDK
QA Contact: general → general
Version: Firefox 14 → unspecified
That's not exactly a bug, then. SDK 1.7 only explicitly targets Firefox 12.0 and 13.*. The stabilization branch (currently 1.8b4) targets Firefox 13.0 and 14.*.

Does Fennec not assume addons are compatible by default like desktop Firefox does?



CCing Matteo for confirmation that everything's actually working as intended.
I had the same issue in the past, and was exactly because the max-version. However, that was before Mobile team fixed the issue:

https://bugzilla.mozilla.org/show_bug.cgi?id=719921

So Firefox 14 Beta definitely doesn't take in account the max-version value when is installing an add-on. I tried on my Samsung Galaxy S2 to install the test.xpi and it works perfectly.

What I can suggest to konstantin, is trying to modify manually the install.rdf or use the stabilization branch, and see if it's resolved somehow. I can't see how Nexus 1 could behave differently in this scenario, but have a check it doesn't harm; and the fact that `cfx run` works but install the XPI not (exactly like the issue I had) makes it worthy to try.

Otherwise could be a different problem related to the platform itself. I already mention it to Matthew Brubeck, he said that another option is that maybe is because the profile folder ran out of disk space (N1 compare to other mobile phones has a very tiny internal storage).

In both cases, in my opinion it's a Fennec Native bug. Even if it is the max-version problem, the add-on should works as expected because the max-version shouldn't be considered by Fennec, as the bug 719921 said. Otherwise it's a regression.
I've changed maxVersion to 15.* in install.rdf, it doesn't help, it still can't load bootstrap.js

There's enough disk space:

# df -h
Filesystem                Size      Used Available Use% Mounted on
tmpfs                   202.8M     32.0K    202.7M   0% /dev
tmpfs                   202.8M         0    202.8M   0% /mnt/asec
tmpfs                   202.8M         0    202.8M   0% /mnt/obb
/dev/block/mtdblock3    145.0M    136.2M      8.8M  94% /system
/dev/block/mtdblock5    196.3M    130.3M     66.0M  66% /data
/dev/block/mtdblock4     95.0M     40.1M     54.9M  42% /cache
/dev/block/mtdblock5    196.3M    130.3M     66.0M  66% /cache/download
/dev/block/vold/179:1
                         14.9G     11.5G      3.4G  77% /mnt/sdcard
/dev/block/vold/179:1
                         14.9G     11.5G      3.4G  77% /mnt/secure/asec
Is the "Extension Test" installed? I saw the following error on desktop Nightly 2012-06-06, after disabling the extension the error was not shown anymore in the error console.

Error: ERROR addons.xpi: Error processing file changes: TypeError: bootstrap is undefined
Source file: resource://app/modules/XPIProvider.jsm
Line: 2412
yes, "test" is listed in the Add-ons Manager as installed. Enabling/disabling it doesn't produce any errors. I also don't observe error message you mentioned, in my case the wording is different: "... is missing bootstrap method startup" which goes after "Error loading bootstrap.js ... Error opening input stream"
Can you try a more recent build of Fennec and see if this was fixed?



CCing Dave to see if he can find someone on the Fennec team (preferably with a Nexus 1) to see if they can reproduce this problem.
> Can you try a more recent build of Fennec and see if this was fixed?

Latest beta from the market (updated Jun 22) still has the same problem. Should I try nightly build?

E/GeckoConsole(26423): [JavaScript Warning: "WARN addons.xpi: Error loading bootstrap.js for jid1-FKA8UfBiBeslnw@jetpack: Error opening input stream (invalid filename?)"]
E/GeckoConsole(26423): [JavaScript Warning: "WARN addons.xpi: Add-on jid1-FKA8UfBiBeslnw@jetpack is missing bootstrap method install" {file: "resource://gre/modules/XPIProvider.jsm" line: 3637}]
E/GeckoConsole(26423): [JavaScript Warning: "WARN addons.xpi: Add-on jid1-FKA8UfBiBeslnw@jetpack is missing bootstrap method startup" {file: "resource://gre/modules/XPIProvider.jsm" line: 3637}]
Assigning to Dave to see if he can get a Nexus device to test this on.
Assignee: nobody → dtownsend+bugmail
QA tell me they have no devices like this to test with so not sure how we can reproduce this.
Priority: -- → P3
Whiteboard: [triage:followup]
will post to yammer to see if anyone has hardware.
Assignee: dtownsend+bugmail → jgriffiths
I tested this using the following:

 - Google N1 running Gingerbread - stock ROM
 - Firefox Beta
 - SDK 1.9
 - Matteo's 'Penny Arcade' demo add-on ( https://github.com/ZER0/penny-arcade-comics )

The add-on installed and worked correctly - I cannot reproduce this bug.

Konstantin - feel free to update / re-open this bug as you see fit, but if we cannot reproduce it, our options are limited.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → WORKSFORME
I'm having the same issue. Both extensions (built using addons sdk and ported from previous fennec) don't work. They are present in the list of installed addons, but bootstrap.js can not be read. It really drives me nuts. Tried on stable version of fennec, beta and nightly. Phone: HTC Sensation
I'm wondering if the locale of Fennec might be making a difference? Is everyone in this bug using the English version of Fennec?
Does anyone still has problems with that issue? I really can't find any workaround and any explanation for this bug. Checked with the latest mobile ff v16 and nightly.
(In reply to Dmitry Dmitriev from comment #15)
> Does anyone still has problems with that issue? I really can't find any
> workaround and any explanation for this bug. Checked with the latest mobile
> ff v16 and nightly.

I do have the same issue.
Environment
HTC One S. Firefox Android Aurora (17.0a2). Machine used for coding + build: MacBook Pro.OSX 10.7.4.
I've attached all files. Code,buildscripts and zippy.
Attached file bootstrap
Attached file build.sh
Attached file config_build
Attached file hello.xpi
Attached file install.rdf
(In reply to tobias.mueller from comment #16)
> (In reply to Dmitry Dmitriev from comment #15)
> > Does anyone still has problems with that issue? I really can't find any
> > workaround and any explanation for this bug. Checked with the latest mobile
> > ff v16 and nightly.
> 
> I do have the same issue.
> Environment
> HTC One S. Firefox Android Aurora (17.0a2). Machine used for coding + build:
> MacBook Pro.OSX 10.7.4.
> I've attached all files. Code,buildscripts and zippy.

I really have no clue why this issue was closed as worksforme. The problem still exists. I've flashed my phone (HTC sensation) twice, used different locale version  of the browser - result is always the same. Seems we should ask all users which are using our service to use another mobile browser which supports our addon (e.g. dolphin). Cool :(
(In reply to Dmitry Dmitriev from comment #22)
> (In reply to tobias.mueller from comment #16)
> > (In reply to Dmitry Dmitriev from comment #15)
> > > Does anyone still has problems with that issue? I really can't find any
> > > workaround and any explanation for this bug. Checked with the latest mobile
> > > ff v16 and nightly.
> > 
> > I do have the same issue.
> > Environment
> > HTC One S. Firefox Android Aurora (17.0a2). Machine used for coding + build:
> > MacBook Pro.OSX 10.7.4.
> > I've attached all files. Code,buildscripts and zippy.
> 
> I really have no clue why this issue was closed as worksforme. The problem
> still exists. I've flashed my phone (HTC sensation) twice, used different
> locale version  of the browser - result is always the same. Seems we should
> ask all users which are using our service to use another mobile browser
> which supports our addon (e.g. dolphin). Cool :(

I think I covered that pretty thoroughly in comment 12 - I resolved it 'works for me' *because it worked for me*. I did not however test on an HTC phone, I instead tested on a Google N1 as this was the original report.

Tobias - this bug originally was reported against the 'Jetpack' add-on sdk, and the worry was that jetpack's packaging tool wasn't working for a specific phone. I loked at the files you attached and noted that your add-on does not use the Jetpack apis at all. 

Tobias: I encouraqe you to file a separate bug against Firefox for Android with the information you've provided here. I feel strongly that what you are seeing is actually a separate issue.
For anyone who still is facing on this issue or will find this bug via google (the only bug which I found about this problem) - temporary solution is to set em:unpack to true as suggested here: https://bugzilla.mozilla.org/show_bug.cgi?id=804011 and https://bugzilla.mozilla.org/show_bug.cgi?id=730040
I had the same problem
Hi, I readed,  Dmitry Dmitriev 2012-10-22 12:20:30 PDT  link, after test and test I solved
When We do xfc --force--mobile xpi, in the bootstrap.js file before the method:
function shutdown(data, reasonCode) {
there is a ';'. 
I set unpack to true and I deleted the ';' and now my extension work also installing it manually. (work the same with unpack set to true or to false )

(I sent it by bt)

(In reply to Dmitry Dmitriev from comment #24)
> For anyone who still is facing on this issue or will find this bug via
> google (the only bug which I found about this problem) - temporary solution
> is to set em:unpack to true as suggested here:
> https://bugzilla.mozilla.org/show_bug.cgi?id=804011 and
> https://bugzilla.mozilla.org/show_bug.cgi?id=730040

(In reply to konstantin.sobolev from comment #0)
> Created attachment 631101 [details]
> test.xpi
> 
> I'm having troubles installing .xpi that I built using sdk for firefox
> mobile (native UI) on my Google Nexus One.
> It works when I run it using "cfx run -a fennec-on-device ..." command, but
> "cfx xpi --force-mobile" builds an .xpi that fails to install.
> 
> Steps:
> =============================================================================
> =
> (addon-sdk-1.7)(U)ksobolev@ksobolev-ld:~/workspace/fire$ mkdir test
> (addon-sdk-1.7)(U)ksobolev@ksobolev-ld:~/workspace/fire$ cd test
> (addon-sdk-1.7)(U)ksobolev@ksobolev-ld:~/workspace/fire/test$ cfx init
> * lib directory created
> * data directory created
> * test directory created
> * doc directory created
> * README.md written
> * package.json written
> * test/test-main.js written
> * lib/main.js written
> * doc/main.md written
> 
> Your sample add-on is now ready.
> Do "cfx test" to test it and "cfx run" to try it.  Have fun!
> 
> (addon-sdk-1.7)(U)ksobolev@ksobolev-ld:~/workspace/fire/test$ vim lib/main.js
> (addon-sdk-1.7)(U)ksobolev@ksobolev-ld:~/workspace/fire/test$ cat lib/main.js
> var pageMod = require("page-mod");
> pageMod.PageMod({
>     include: "*",
>     contentScript: 'window.alert("test OK");'
> });
> console.log("The add-on is running.");
> 
> (addon-sdk-1.7)(U)ksobolev@ksobolev-ld:~/workspace/fire/test$ cfx xpi
> --force-mobile
> No 'id' in package.json: creating a new ID for you.
> package.json modified: please re-run 'cfx xpi'
> (addon-sdk-1.7)(U)ksobolev@ksobolev-ld:~/workspace/fire/test$ cfx xpi
> --force-mobile
> Exporting extension to test.xpi.
> 
> # THIS WORKS
> (addon-sdk-1.7)(U)ksobolev@ksobolev-ld:~/workspace/fire/test$ cfx run -a
> fennec-on-device -b /home/ksobolev/android-sdk-linux_x86/platform-tools/adb
> --mobile-app firefox_beta --force-mobile
> 
> (addon-sdk-1.7)(U)ksobolev@ksobolev-ld:~/workspace/fire/test$
> /home/ksobolev/android-sdk-linux_x86/platform-tools/adb push test.xpi
> /mnt/sdcard 977 KB/s (131046 bytes in 0.130s)
> # Then install in using file:///mnt/sdcard/test.xpi in FF mobile
> =============================================================================
> =
> 
> Here's what pops up in logcat during installation:
> =============================================================================
> =
> E/GeckoConsole(27641): [JavaScript Warning: "WARN addons.xpi: Error loading
> bootstrap.js for jid1-KNiUQWo8BpIY5w@jetpack: Error opening input stream
> (invalid filename?)"]
> E/GeckoConsole(27641): [JavaScript Warning: "WARN addons.xpi: Add-on
> jid1-KNiUQWo8BpIY5w@jetpack is missing bootstrap method install" {file:
> "resource://gre/modules/XPIProvider.jsm" line: 3637}]
> I/GeckoApp(27641): Got message: Toast:Show
> E/GeckoConsole(27641): [JavaScript Warning: "WARN addons.xpi: Add-on
> jid1-KNiUQWo8BpIY5w@jetpack is missing bootstrap method startup" {file:
> "resource://gre/modules/XPIProvider.jsm" line: 3637}]
> =============================================================================
> =
> 
> as a result plugin is listed among installed plugins but it doesn't work.
> 
> SDK 1.7, Firefox 14 beta, N1 with stock ROM. test.xpi attached
> 
> see also: https://forums.mozilla.org/addons/viewtopic.php?f=27&t=10753
I can definitely confirm this is happening with the current beta and yesterdays (2013-05-08) Nightly on a generic tablet running 4.0.3.

You can easily reproduce by trying to install the view-source exampel from https://developer.mozilla.org/en-US/docs/Extensions/Mobile/Walkthrough

If you try to install from the devices SDcard as per the walk through, you see this via logcat:

E/GeckoConsole( 4423): [JavaScript Warning: "WARN addons.xpi: Error loading bootstrap.js for view-source@mydomain.org: Error opening input stream (invalid filename?)" {file: "resource://gre/modules/XPIProvider.jsm" line: 3733}]
E/GeckoConsole( 4423): [JavaScript Warning: "WARN addons.xpi: Add-on view-source@mydomain.org is missing bootstrap method install" {file: "resource://gre/modules/XPIProvider.jsm" line: 3785}]
E/GeckoConsole( 4423): [JavaScript Warning: "WARN addons.xpi: Add-on view-source@mydomain.org is missing bootstrap method startup" {file: "resource://gre/modules/XPIProvider.jsm" line: 3785}]

And same symptoms, the add-on is listed in fennecs list of installed add-ons BUT is not actually working.

Installing the very same XPI via a http url works fine!
install xpi from sdcard have this problem here too.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: