Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Building chromium android as library [android aar archive]

Want to build chrome project as aar instead of apk.

Tried to change target_type to android_library from android_apk for chrome public apk but doesn't work. Looks like it would need a series of changes in different files for eg rules.gni, internal_rules.gni etc.

If someone has done similar task amd can share the info would be great help

like image 397
Robust Avatar asked Sep 13 '25 00:09

Robust


1 Answers

So it depends on what you want to do with Chrome/Chromium as a AAR/library.

Should you want to embed your own WebView independent of the system WebView in your app there are few choices.

For historical context, before Android 5.0 (Nov 2014) the Android System WebView was only updated with an OS update. With Android 5.0 the System WebView had become independently updatable through the Google Play Store. Developers supporting older devices or those that were isolated from the internet could use The Crosswalk Project archive.org link for a time until the project was shutdown around 2016. I believe most of the documentation is in archive.org should you want to go down that path. If you are dealing with legacy hardware in a closed environment this might be suitable.

If you are looking for something modern and updated, Mozilla GeckoView wiki page is available. As GeckoView is not a 1:1 drop in for the Android WebView you will have to change APIs and match up to appropriate minSDK for which ever version is being included.

Be aware that the Chromium Project has documentation on building a system WebView,

https://chromium.googlesource.com/chromium/src/+/HEAD/android_webview/docs/aosp-system-integration.md

It is only for Custom ROM / system integrators due to the required system signing and the configuration required for different versions of Android.

like image 112
Morrison Chang Avatar answered Sep 15 '25 13:09

Morrison Chang