Support dynamic delivery / Android App Bundle
Categories
(GeckoView :: General, enhancement, P1)
Tracking
(firefox96 fixed)
Tracking | Status | |
---|---|---|
firefox96 | --- | fixed |
People
(Reporter: cnevinchen, Assigned: agi)
References
(Blocks 1 open bug)
Details
(Whiteboard: [geckoview:rocket] [geckoview:m93][geckoview:m94][geckoview:m95][geckoview:m96], [wptsync upstream])
Attachments
(9 files, 2 obsolete files)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
Dynamic delivery empowers the users to have a smaller first install APK size, and then install the dynamic features as extra APKs if they want to use that feature. see AAB and Dynamic delivery
The user will first get the base.apk, then download splits_feature_module_name.apk from Play Store
Our current GeckoView code (e.g. NSSBridge / GeckoThread / GeckoJarReader) will need the apk path to load related libraries, but this won't work dynamic delivery world cause the APK name will change according to abi/laguage/density splits.
Here's one example of only splits the abi with one dynamic feature
"/data/app/org.mozilla.rocket.debug.firebase-n8F5hLsnz5J5dNOuixTgDQ==/base.apk"
"/data/app/org.mozilla.rocket.debug.firebase-n8F5hLsnz5J5dNOuixTgDQ==/split_geckopower.apk"
"/data/app/org.mozilla.rocket.debug.firebase-n8F5hLsnz5J5dNOuixTgDQ==/split_geckopower.config.x86.apk"
I suggest to replace context.getPackageResourcePath()
to context.applicationInfo.splitSourceDirs
and context.applicationInfo.publicSourceDir
to get both base and split APKs.
Every Java class has it's ClassLoader(Android's PathClassLoader) and has its DexPathList contains all the dex files, but I can't find an api to get them
DexPathList[[zip file "/data/app/org.mozilla.rocket.debug.firebase-n8F5hLsnz5J5dNOuixTgDQ==/base.apk", zip file "/data/app/org.mozilla.rocket.debug.firebase-n8F5hLsnz5J5dNOuixTgDQ==/split_geckopower.apk", zip file "/data/app/org.mozilla.rocket.debug.firebase-n8F5hLsnz5J5dNOuixTgDQ==/split_geckopower.config.x86.apk"],nativeLibraryDirectories=[/data/app/org.mozilla.rocket.debug.firebase-n8F5hLsnz5J5dNOuixTgDQ==/lib/x86, /data/app/org.mozilla.rocket.debug.firebase-n8F5hLsnz5J5dNOuixTgDQ==/base.apk!/lib/x86, /data/app/org.mozilla.rocket.debug.firebase-n8F5hLsnz5J5dNOuixTgDQ==/split_geckopower.apk!/lib/x86, /data/app/org.mozilla.rocket.debug.firebase-n8F5hLsnz5J5dNOuixTgDQ==/split_geckopower.config.x86.apk!/lib/x86, /system/lib]]
Currently if we really want to work around this, we need to have a our own NSSBridge/GeckoThread/GeckoJarReader implementation and use it like this . But this approach isn't maintanable.
It'll be great to have dynamic delivery support in GeckoView.
Updated•6 years ago
|
Comment 1•6 years ago
•
|
||
App Bundles might be a good solution for bug 1548679.
Updated•6 years ago
|
Assignee | ||
Comment 2•6 years ago
|
||
Resetting priority so we can re-prioritize this. This is the only blocker for shipping GV as an app bundle.
Comment 3•6 years ago
|
||
Needs a priority. NI'ing Andreas to help.
Comment 4•6 years ago
|
||
Firefox Lite would like this feature.
Updated•6 years ago
|
Comment 5•6 years ago
|
||
How soon is Firefox Lite wanting to have this? None of our other consumers (FxR, Fenix) are asking for this yet, and it would be good to know so that we can properly prioritise.
Comment 6•6 years ago
|
||
Hi Emily, the Firefox Lite team would like to have this feature available from your team in Q4 so we can work on it and deliver features based on it in Q1 2020. Thanks
Comment 7•6 years ago
|
||
I'm editing a bunch of GeckoView bugs. If you'd like to filter all this bugmail, search and destroy emails containing this UUID:
e88a5094-0fc0-4b7c-b7c5-aef00a11dbc9
Comment 8•6 years ago
|
||
Hey Joe, can you create a 1-pager with justification and rationale? That will help us with prioritization.
Updated•5 years ago
|
Comment 10•5 years ago
|
||
Updated•5 years ago
|
Comment 11•4 years ago
|
||
Still not working in 80.0.20200903001900 stable version
Comment 12•4 years ago
|
||
This issue makes it impossible for Geckoview to be used in new projects since App Bundles are now (August 2021) required for new Android Apps (see https://android-developers.googleblog.com/2021/06/the-future-of-android-app-bundles-is.html). Meaning the projects using Geckoview can only decrease from here.
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 14•4 years ago
|
||
When using App Bundles, the so files will be in the APK splits, instead of
being in the folder specified by the native lib.
dlopen and dlsym do the right thing on Android and automatically figure out
where the library is.
I'm not sure if this is a good approach (e.g. is it safe? could another app
potentially hijack our libraries?). If it isn't we could find the right path
using some code that chromium has.
Updated•4 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Assignee | ||
Comment 15•3 years ago
|
||
Before this patch, we would load mozglue using the unqualified
System.loadLibrary("mozglue")
and then we would try to load all the other
native libraries from the path returned from nativeLibraryDir
.
Note that since the path is unqualified, we might end up loading a library
that's not inside the APK, potentially a malicious one.
Android App Bundles (or AAB) is a new feature of Android where apps can be
split in multiple APKs (called "splits"). Each APK split contains a functinal
part of the app, e.g. a specific resolution asset folder, all the native
libraries for one CPU architecture etc.
For AAB, nativeLibraryDir
returns an empty folder as the libraries are
stored, uncompressed, inside one of the APK splits, so GeckoView fails to load
libxul and other libraries when starting up.
The current code also doesn't work for any case where System.loadLibrary
fails to load mozglue (we do have code that accounts for that, but I'm not sure
how much of it is funcitonal).
To fix that, we locate the mozglue using code ported from Chromium and use that
to locate all the other native libraries.
Note this still doesn't fix the problem of loading an unqualified mozglue
library, but there's not a lot we can do about that right now (and that's not a
new problem, so we can address it in a separate patch).
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Assignee | ||
Comment 16•3 years ago
|
||
This tool is used to install AAB packages to devices.
AAB is the new package format for Android Apps and will supersede APK.
Assignee | ||
Comment 17•3 years ago
|
||
Assignee | ||
Comment 18•3 years ago
|
||
The fact that the test runner app is defined inside the geckoview test package
has always felt like a hack to me. I've mistakenly thought that
TestRunnerActivity was used in GeckoView's junit tests many times (even though
that's not the case).
From what I can see, there's no way to generate an AAB package for androidTest,
so to be able to run Gecko tests as AAB we finally need to define the
TestRunner as an ordinary package instead.
Assignee | ||
Comment 19•3 years ago
|
||
This allows variants to override targets.
Assignee | ||
Comment 20•3 years ago
|
||
Assignee | ||
Comment 21•3 years ago
|
||
This patch adds a new command line argument --aab which allows users to install
GVE as an AAB.
This will also be used in a future patch to install the test runner as AAB.
Assignee | ||
Comment 22•3 years ago
|
||
This patch adds a new Mochitest variant which installs the test runner app as
AAB.
Comment 23•3 years ago
|
||
Is there any production-ready solution for uploading GeckoView based .aab android app to Google PlayStore without getting the following crash?
021-10-26 22:09:37.959 32298-3601/? E/AndroidRuntime: FATAL EXCEPTION: Gecko
Process: com.example.geckoviewapp, PID: 32298
java.lang.Exception: Error loading sqlite libraries
Since other variants of Mozilla Browser also use GeckoView and they update the Google Playstore App regularly without getting this crash.
How can we build .aab in a way that it is distributable through Google Playstore without Crash?
This may be a serious concern for developers who used GeckoView in their App and now are unable to publish the app to Google Playstore.
Your help and guidance will be appreciated.
Assignee | ||
Comment 24•3 years ago
|
||
(In reply to Rahul Shyokand from comment #23)
Is there any production-ready solution for uploading GeckoView based .aab android app to Google PlayStore without getting the following crash?
021-10-26 22:09:37.959 32298-3601/? E/AndroidRuntime: FATAL EXCEPTION: Gecko Process: com.example.geckoviewapp, PID: 32298 java.lang.Exception: Error loading sqlite libraries
Since other variants of Mozilla Browser also use GeckoView and they update the Google Playstore App regularly without getting this crash.
How can we build .aab in a way that it is distributable through Google Playstore without Crash?This may be a serious concern for developers who used GeckoView in their App and now are unable to publish the app to Google Playstore.
Your help and guidance will be appreciated.
Hi there, the fix will be available in GeckoView 96. Meanwhile you should be able to set extractNativeLibs = true
in AndroidManifest.xml
and android.bundle.enableUncompressedNativeLibs = false
in gradle.properties
, see the following:
https://developer.android.com/guide/topics/manifest/application-element#extractNativeLibs
https://developer.android.com/studio/releases/gradle-plugin#behavior-changes
Updated•3 years ago
|
Assignee | ||
Comment 25•3 years ago
|
||
Updated•3 years ago
|
Assignee | ||
Comment 26•3 years ago
|
||
./mach lint --outgoing --fix keeps changing this for me.
Comment 27•3 years ago
|
||
Comment 29•3 years ago
|
||
Comment 30•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/94012b2abf6f
https://hg.mozilla.org/mozilla-central/rev/67001525a262
https://hg.mozilla.org/mozilla-central/rev/28475cfdf30b
https://hg.mozilla.org/mozilla-central/rev/c03034fa7d47
https://hg.mozilla.org/mozilla-central/rev/86c4c2070378
https://hg.mozilla.org/mozilla-central/rev/69bd7293edb8
https://hg.mozilla.org/mozilla-central/rev/f7888063e67e
https://hg.mozilla.org/mozilla-central/rev/44a00ee73528
Comment 31•3 years ago
|
||
bugherder |
Comment 32•3 years ago
|
||
(In reply to Agi Sferro | :agi | ni? for questions | ⏰ PST | he/him from comment #24)
(In reply to Rahul Shyokand from comment #23)
Is there any production-ready solution for uploading GeckoView based .aab android app to Google PlayStore without getting the following crash?
021-10-26 22:09:37.959 32298-3601/? E/AndroidRuntime: FATAL EXCEPTION: Gecko Process: com.example.geckoviewapp, PID: 32298 java.lang.Exception: Error loading sqlite libraries
Since other variants of Mozilla Browser also use GeckoView and they update the Google Playstore App regularly without getting this crash.
How can we build .aab in a way that it is distributable through Google Playstore without Crash?This may be a serious concern for developers who used GeckoView in their App and now are unable to publish the app to Google Playstore.
Your help and guidance will be appreciated.Hi there, the fix will be available in GeckoView 96. Meanwhile you should be able to set
extractNativeLibs = true
inAndroidManifest.xml
andandroid.bundle.enableUncompressedNativeLibs = false
ingradle.properties
, see the following:https://developer.android.com/guide/topics/manifest/application-element#extractNativeLibs
https://developer.android.com/studio/releases/gradle-plugin#behavior-changes
Thank you very much.
This worked when I added android.bundle.enableUncompressedNativeLibs = false
in gradle.properties
.
Now Gecko Libs are able to load with a .aab bundle distributed through Google Playstore.
Description
•