packaged app on Fennec fails in nsIAppsService::getAppInfo with "unsupported apps platform"

RESOLVED FIXED in Firefox 27

Status

()

RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: myk, Assigned: myk)

Tracking

({regression})

unspecified
Firefox 27
ARM
Android
regression
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

5 years ago
Created attachment 807551 [details] [diff] [review]
0001-define-MOZ_FENNEC-for-preprocessor.patch

Bug 917310 broke running packaged apps on Fennec, which fails with:

E/GeckoConsole(13632): [JavaScript Error: "[Exception... "'Error: Unsupported apps platform' when calling method: [nsIAppsService::getAppInfo]"  nsresult: "0x8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)"  location: "JS frame :: jar:jar:file:///data/app/org.mozilla.fennec_myk-1.apk!/assets/omni.ja!/components/AppProtocolHandler.js :: app_phGetAppInfo :: line 40"  data: no]" {file: "jar:jar:file:///data/app/org.mozilla.fennec_myk-1.apk!/assets/omni.ja!/components/AppProtocolHandler.js" line: 40}]

The problem is that MOZ_FENNEC, which I added to mobile/android/confvars.sh in bug 797613, isn't defined when the preprocessor processes toolkit/webapps/WebappOSUtils.jsm, which uses MOZ_FENNEC to determine the implementation of getInstallPath.

I'm not a build expert, but the fix appears to be to AC_DEFINE(MOZ_FENNEC) in configure.in.  The relevant part of configure.in says to use MOZ_BUILD_APP instead, but config/Preprocessor.py is too primitive to use MOZ_BUILD_APP in this case, since the value of that variable is "mobile/android" for Fennec, which contains a slash character, and Preprocessor.py can only compare MOZ_BUILD_APP to a string of letters (\w+).
Attachment #807551 - Flags: review?(mh+mozilla)
Comment on attachment 807551 [details] [diff] [review]
0001-define-MOZ_FENNEC-for-preprocessor.patch

Review of attachment 807551 [details] [diff] [review]:
-----------------------------------------------------------------

Considering toolkit/webapps/WebappOSUtils.jsm is the only file using MOZ_FENNEC, I'd rather see the define added in toolkit/webapps, based on MOZ_BUILD_APP. (and you can remove MOZ_FENNEC from confvars.sh, while you're here)
Attachment #807551 - Flags: review?(mh+mozilla) → review-
(Assignee)

Comment 2

5 years ago
Created attachment 807578 [details] [diff] [review]
0001-define-MOZ_FENNEC-when-building-mobile-android.patch
Attachment #807578 - Flags: review?(mh+mozilla)
(Assignee)

Updated

5 years ago
Attachment #807551 - Attachment is obsolete: true
Attachment #807578 - Flags: review?(mh+mozilla) → review+
https://hg.mozilla.org/mozilla-central/rev/d5de24a40c49
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 27
You need to log in before you can comment on or make changes to this bug.