Closed
Bug 1320310
Opened 8 years ago
Closed 8 years ago
Local builds: Home screen icon disappears when switching between gradle/mach build
Categories
(Firefox Build System :: Android Studio and Gradle Integration, defect)
Firefox Build System
Android Studio and Gradle Integration
All
Android
Tracking
(firefox55 fixed)
RESOLVED
FIXED
mozilla55
Tracking | Status | |
---|---|---|
firefox55 | --- | fixed |
People
(Reporter: sebastian, Assigned: nalexander)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
Whenever I build with mach/gradle, install the app, add a home screen icon and then switch to the other build mechanism (mach -> gradle, gradle -> mach) then the home screen icon disappears on install.
For local builds this is not really an issue, but it's an indicator that the manifest entries might be slightly different and then this could be an issue if we switch release builds to gradle - e.g. see bug 1268455, bug 1256615.
Comment 1•8 years ago
|
||
Diff of AndroidManifest.xml between mach and Gradle build.
There are two diffs, first is the component name from activity-alias is not full class name but short class name starts with a dot(.App). Gradle build appends the prefix "org.mozilla.gecko" from the package of the manifest which mach build don't. This is the root cause of this bug because the component name are different in Launcher app design.
I think explicit specify the full class name is more consistent and better comparing to current dot prefix behavior. But on the other hand, one-time shortcut missing on home screen is still an impact to current user.
@Sebastian: What do you think?
Flags: needinfo?(s.kaspari)
Reporter | ||
Comment 2•8 years ago
|
||
> I think explicit specify the full class name is more consistent and better comparing to current
> dot prefix behavior. But on the other hand, one-time shortcut missing on home screen is still an
> impact to current user.
Yeah, it would be nicer to use the full class name. However we can't purge launcher icons from all our users. And we have partnerships where partners add Firefox to the home screen - it would be counter productive to remove them again with an update. :)
I wonder if we can find a workaround so that this doesn't happen when building with gradle?
And we should file another bug for the AppMeasurement things. Even if we can't prevent them from getting into the manifest we at least want to disable the reporting (afaik you can do that with a specific meta-data tag in the manifest).
Flags: needinfo?(s.kaspari)
Assignee | ||
Comment 3•8 years ago
|
||
(In reply to Sebastian Kaspari (:sebastian) from comment #2)
> > I think explicit specify the full class name is more consistent and better comparing to current
> > dot prefix behavior. But on the other hand, one-time shortcut missing on home screen is still an
> > impact to current user.
>
> Yeah, it would be nicer to use the full class name. However we can't purge
> launcher icons from all our users. And we have partnerships where partners
> add Firefox to the home screen - it would be counter productive to remove
> them again with an update. :)
Sadly, this is one of these things that I think the launcher(s) get wrong and we will have to support essentially forever.
> I wonder if we can find a workaround so that this doesn't happen when
> building with gradle?
It's not easy, but we can probably find a way to achieve this in Gradle. Two thoughts:
- does inserting a dummy empty variable prevent Gradle doing the expansion? Like "${dummyPlaceholder}.App".
- it is possible, but not easy, to post-process the various .xml files produced. I've tried and failed to do this for certain things in the past.
> And we should file another bug for the AppMeasurement things. Even if we
> can't prevent them from getting into the manifest we at least want to
> disable the reporting (afaik you can do that with a specific meta-data tag
> in the manifest).
I concur.
Comment hidden (mozreview-request) |
Comment 5•8 years ago
|
||
https://android.googlesource.com/platform/tools/base/+/master/sdk-common/src/main/java/com/android/ide/common/xml/AndroidManifestParser.java#393
I also found there is no way to skip the prepend process. Looks like the post processing is the only workaround.
Nice hack! Thanks Nick.
Reporter | ||
Comment 6•8 years ago
|
||
mozreview-review |
Comment on attachment 8857313 [details]
Bug 1320310 - Post-process Gradle-produced Android manifest.
https://reviewboard.mozilla.org/r/129278/#review131902
Nice :)
Attachment #8857313 -
Flags: review?(s.kaspari) → review+
Pushed by nalexander@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/364265dfdf2c
Post-process Gradle-produced Android manifest. r=sebastian
Comment 8•8 years ago
|
||
Backed out for gradle related failures:
https://hg.mozilla.org/integration/autoland/rev/7da164b38b603436a1a13f9d372ffc1beaad1d9f
Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&revision=364265dfdf2c2fc7ad8805ac88b2705f40681598&filter-resultStatus=testfailed&filter-resultStatus=busted&filter-resultStatus=exception&filter-resultStatus=retry&filter-resultStatus=usercancel&filter-resultStatus=runnable
Flags: needinfo?(nalexander)
Comment hidden (mozreview-request) |
Reporter | ||
Updated•8 years ago
|
Assignee: nobody → nalexander
Status: NEW → ASSIGNED
Comment 10•8 years ago
|
||
Pushed by nalexander@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c85665cc6260
Post-process Gradle-produced Android manifest. r=sebastian
Comment 11•8 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox55:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 55
Assignee | ||
Comment 12•8 years ago
|
||
Clearing NI, since I fixed and landed this.
Flags: needinfo?(nalexander)
Comment 14•8 years ago
|
||
(In reply to Nick Alexander :nalexander from comment #13)
> maliu: would you mind testing this?
Verify fixed; both of the AndroidManifest.xml are identical.
However sadly, there is a regression while integrating with android-studio. We can no longer launch activity from android-studio because the component it tried to launch is the one with prefix, not the modified one. Even when I try to specify manually, still fail because android-studio thinks the component does not exist.
```
$ adb shell am start -n "org.mozilla.fennec_maliu/org.mozilla.gecko.App" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Error while executing: am start -n "org.mozilla.fennec_maliu/org.mozilla.gecko.App" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=org.mozilla.fennec_maliu/org.mozilla.gecko.App }
Error type 3
Error: Activity class {org.mozilla.fennec_maliu/org.mozilla.gecko.App} does not exist.
Error while Launching activity
```
This regression with android-studio also blocks us using instant-run. T_T
@Nick
Consider sending a patch to android-studio? ;)
Flags: needinfo?(max) → needinfo?(nalexander)
Assignee | ||
Comment 15•8 years ago
|
||
Huh, that's interesting. I wonder what would happen if we added a second alias for .App as well? I'll have to think that through.
Flags: needinfo?(nalexander)
Reporter | ||
Comment 16•8 years ago
|
||
Nick, I just remembered the bouncer and was wondering whether we need to apply the same post-processing there?
Flags: needinfo?(nalexander)
Assignee | ||
Comment 17•8 years ago
|
||
(In reply to Sebastian Kaspari (:sebastian) from comment #16)
> Nick, I just remembered the bouncer and was wondering whether we need to
> apply the same post-processing there?
Yeah, I guess we should. I kind of want to get rid of the bouncer entirely, but until we do that, you're right -- we should ensure that the Gradle bouncer and app APKs agree. I'll file.
Flags: needinfo?(nalexander)
Assignee | ||
Updated•7 years ago
|
No longer blocks: gradle-automation
Assignee | ||
Updated•7 years ago
|
Blocks: gradle-automation-v2
Updated•5 years ago
|
Product: Firefox for Android → Firefox Build System
Target Milestone: Firefox 55 → mozilla55
You need to log in
before you can comment on or make changes to this bug.
Description
•