[Chromium-Android] Build App Bundle

362 views
Skip to first unread message

毕然

unread,
Jun 6, 2018, 1:03:17 AM6/6/18
to Chromium-dev
Hi,

I tried to reduce APK size of Chromium build as well as to download dynamic features as user demands. And I found Android App Bundle which can support that. But I didn't find any build command I can use to build Chromium as App Bundle. Are there any plans to support that? If not, how I can I do it myself? Would anyone like to shed lights on this?

Thanks,
Ran

David Turner

unread,
Jun 6, 2018, 4:33:49 AM6/6/18
to bir...@gmail.com, chromium-dev
Hello,
On Wed, Jun 6, 2018 at 7:03 AM 毕然 <bir...@gmail.com> wrote:
Hi,

I tried to reduce APK size of Chromium build as well as to download dynamic features as user demands. And I found Android App Bundle which can support that. But I didn't find any build command I can use to build Chromium as App Bundle. Are there any plans to support that? If not, how I can I do it myself? Would anyone like to shed lights on this?

Yes, we are working on it, but it's not ready yet. See http://crbug.com/820459 for details.

Regards,

- Digit
 
Thanks,
Ran

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/96c30caf-6f2b-4b6d-b548-55cb802b5160%40chromium.org.
Message has been deleted

毕然

unread,
Jun 7, 2018, 2:54:39 AM6/7/18
to Chromium-dev, bir...@gmail.com, di...@chromium.org
Thanks David.

I guess App Bundle would be fully supported after http://crbug.com/820459 checked in, right? And when do you think it will be completely ready? Do you have a schedule?

Thanks,
Ran


在 2018年6月6日星期三 UTC+8下午4:33:49,David Turner写道:

David Turner

unread,
Jun 7, 2018, 11:49:11 AM6/7/18
to 毕然, chromium-dev
On Thu, Jun 7, 2018 at 8:54 AM 毕然 <bir...@gmail.com> wrote:
Thanks David.

I guess App Bundle would be fully supported after http://crbug.com/820459 checked in, right? And when do you think it will be completely ready? Do you have a schedule?

We're starting by adding support for building a bundle that uses language-based resource targeting. Feature splits will likely be supported after that, but there is no schedule to share (there are plenty of subtle / thorny issues to address). Sorry.

毕然

unread,
Jan 14, 2019, 1:44:06 AM1/14/19
to Chromium-dev, bir...@gmail.com, di...@chromium.org
Hi David,

I believe chromium has supported App Bundle already. I saw some keywords in the build script. Would you please share some docs related to that?

Thanks,
Ran


在 2018年6月7日星期四 UTC+8下午11:49:11,David Turner写道:

David Turner

unread,
Jan 14, 2019, 7:41:44 AM1/14/19
to 毕然, Chromium-dev
Le lun. 14 janv. 2019 à 07:44, 毕然 <bir...@gmail.com> a écrit :
Hi David,

I believe chromium has supported App Bundle already. I saw some keywords in the build script. Would you please share some docs related to that?

毕然

unread,
Jan 17, 2019, 8:53:15 AM1/17/19
to Chromium-dev, bir...@gmail.com, di...@chromium.org
Thanks David.

I saw Chromium has a property `featureSplit` in manifest files of bundle. Do you know what does that mean? I don't see this property in android official document.

Thanks,
Ran

在 2019年1月14日星期一 UTC+8下午8:41:44,David Turner写道:

毕然

unread,
Jan 17, 2019, 10:02:00 AM1/17/19
to Chromium-dev, bir...@gmail.com, di...@chromium.org
Another question is about standalone apk.

I built an app bundle as the guides shows in the document. And use this (out/Release/bin/foo_bundle build-bundle-apks) to create apks. And I found a standalone apk as well as some split apks in the output folder. But I dump the dexes in the standalone.apk. I can only find classes defined in base module. But classes defined in other modules are not there. Do you have any ideas what may cause this issue. Or is that by design?

Thanks,
Ran

在 2019年1月14日星期一 UTC+8下午8:41:44,David Turner写道:

David Turner

unread,
Jan 18, 2019, 3:51:26 AM1/18/19
to 毕然, Chromium-dev
Le jeu. 17 janv. 2019 à 14:53, 毕然 <bir...@gmail.com> a écrit :
Thanks David.

I saw Chromium has a property `featureSplit` in manifest files of bundle. Do you know what does that mean? I don't see this property in android official document.


This is due to a breaking change in the latest bundletool release (0.8.0). From the release notes:

  • The split attribute is no longer added automatically by Bundletool, it must be already present in the AndroidManifest.xml. Note that in the original AndroidManifest.xml, this attribute is named featureSplit(it is later renamed by aapt2). For users of the Android Gradle Plugin, this is a no-op since AGP adds it automatically.

David Turner

unread,
Jan 18, 2019, 4:07:35 AM1/18/19
to 毕然, Chromium-dev
Le jeu. 17 janv. 2019 à 16:02, 毕然 <bir...@gmail.com> a écrit :
Another question is about standalone apk.

I built an app bundle as the guides shows in the document. And use this (out/Release/bin/foo_bundle build-bundle-apks) to create apks. And I found a standalone apk as well as some split apks in the output folder. But I dump the dexes in the standalone.apk. I can only find classes defined in base module. But classes defined in other modules are not there. Do you have any ideas what may cause this issue. Or is that by design?

Can you try rebuilding with the just-rolled bundletool 0.8.0? Because the .apks archive that we're currently generating with it do not have a standalone.apk when using build-bundle-apks.

毕然

unread,
Jan 21, 2019, 9:32:16 AM1/21/19
to Chromium-dev, bir...@gmail.com, di...@chromium.org
Hi David,

Thanks for your patience.

Actually I am building a chrome_public_apk instread of chrome_modern_public_apk. Even with 0.8.0, I can still build a standalone apk. I am curious about how do you test your bundles without building a standalone apk. Do you use the install command in bundletool? But I can't install the dynamic module with that command. Only the base module included.

BTW, I didn't pull the latest code of Chromium. The branch I am working on is still based on bundletool 0.6.0.

Another issue I would like to discuss with you is about the package names. As I can see in Chromium's code. All the package name defined in manifest files of dynamic modules are as exactly same as the app itself. When I built the aab this way, I would get a failure on installing the bundle. There would be a dex merge issue about that. Any ideas about that?

Thanks,
Ran




在 2019年1月18日星期五 UTC+8下午5:07:35,David Turner写道:

David Turner

unread,
Jan 22, 2019, 5:56:40 AM1/22/19
to 毕然, Chromium-dev
Le lun. 21 janv. 2019 à 15:32, 毕然 <bir...@gmail.com> a écrit :
Hi David,

Thanks for your patience.

Actually I am building a chrome_public_apk instread of chrome_modern_public_apk. Even with 0.8.0, I can still build a standalone apk. I am curious about how do you test your bundles without building a standalone apk. Do you use the install command in bundletool? But I can't install the dynamic module with that command. Only the base module included.

You can use the bundletool wrapper (build/android/gyp/bundletool.py) and use --modules=_ALL_ to specify the installation of all modules (this is a new feature in 0.8.0).
We haven't updated the wrapper script to support this yet though.
 
BTW, I didn't pull the latest code of Chromium. The branch I am working on is still based on bundletool 0.6.0.


There have been significant changes to bundletool in the past, even the latest release (0.8.0) provides breaking changes, so I would first recommend upgrading to the top of the tree first, otherwise you're going to re-experience some of the pains we've been through :-( 
 
Another issue I would like to discuss with you is about the package names. As I can see in Chromium's code. All the package name defined in manifest files of dynamic modules are as exactly same as the app itself. When I built the aab this way, I would get a failure on installing the bundle. There would be a dex merge issue about that. Any ideas about that?

I'm not sure what the exact problem here is, but I strongly recommend first upgrading to the latest version of bundletool and our build rules first.

- Digit

毕然

unread,
Jan 22, 2019, 6:45:13 AM1/22/19
to Chromium-dev, bir...@gmail.com, di...@chromium.org
Thanks David. I updated the bundle tool as you suggested. And can install all modules with the corresponding parameters. I have been suffering a lot to try to build a standalone apk.

I saw all of modules in Chromium are target for Android L and above. Because of that, none of them support fusing for now. Do you have plans to support that in future? The reason I ask this is because I  will encounter the dex merge issue if I set the fusing to true.

Thanks,
Ran


在 2019年1月22日星期二 UTC+8下午6:56:40,David Turner写道:

David Turner

unread,
Jan 22, 2019, 12:51:38 PM1/22/19
to 毕然, Chromium-dev
Le mar. 22 janv. 2019 à 12:45, 毕然 <bir...@gmail.com> a écrit :
Thanks David. I updated the bundle tool as you suggested. And can install all modules with the corresponding parameters. I have been suffering a lot to try to build a standalone apk.

I saw all of modules in Chromium are target for Android L and above. Because of that, none of them support fusing for now. Do you have plans to support that in future? The reason I ask this is because I  will encounter the dex merge issue if I set the fusing to true.

For now we don't plan on using fusing (instead relying on the APKs for older Android releases). This may change in the future, but there is no use-case for us right now.

毕然

unread,
Jan 25, 2019, 5:09:05 AM1/25/19
to Chromium-dev, bir...@gmail.com, di...@chromium.org
Hi David,

I built the app bundle successfully and it worked pretty well in my local test. But when I uploaded this bundle to Google Play, I can't download dynamic feature successfully and I can always get an error code MODULE_UNAVAILABLE. I can dump the corresponding module and installed locally. But I couldn't get it from google play. Is there any mismatches between bundle tool and Google Play? Or any ideas about that?

Thanks,
Ran

在 2019年1月23日星期三 UTC+8上午1:51:38,David Turner写道:

毕然

unread,
Jan 25, 2019, 6:53:35 AM1/25/19
to Chromium-dev, bir...@gmail.com, di...@chromium.org
I can download the module successully now. But the module was not installed automatically after downloaded. Wired.... 

在 2019年1月25日星期五 UTC+8下午6:09:05,毕然写道:
Reply all
Reply to author
Forward
0 new messages