Android Developers Backstage cover image

Android Developers Backstage

Episode 202: AndroidX, Gradle and Metalava

Nov 1, 2023
Aurimas Liutikas from the AndroidX team talks about performance tuning Gradle builds, remote caching, and tracking API compatibility with Metalava. They also discuss code optimization in Gradle, cross-sharing knowledge, understanding Gradle in Android development, and versioning and stability of AndroidX libraries and APIs.
53:56

Podcast summary created with Snipd AI

Quick takeaways

  • AndroidX uses Gradle configuration caching, local caching, and remote caching to optimize build processes and improve build speed.
  • AndroidX prioritizes API compatibility through the use of Metalava and API lint, ensuring consistent and compatible APIs.

Deep dives

Optimizing AndroidX Build with Gradle and Configuration Caching

The AndroidX build system uses Gradle and configuration caching to optimize its build process. With approximately 800 Gradle modules, the majority being Android, Kotlin, and Kotlin Multi-platform Java, AndroidX leverages AGP, Kotlin Gradle plugin, and other tools to streamline its workflow. By adopting configuration cache early on and enabling it in Gradle ADOT1, AndroidX significantly improved its configuration phase, allowing faster builds. Additionally, AndroidX utilizes local caching for faster rebuilds and remote caching for sharing build results across the team through cloud storage. The use of remote caching enhanced their pre-submit times and iteration speed, while the decision to mark certain packaging tasks, like zip and non-compressed jar tasks, as not cacheable improved their overall performance.

Get the Snipd
podcast app

Unlock the knowledge in podcasts with the podcast player of the future.
App store bannerPlay store banner

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode

Save any
moment

Hear something you like? Tap your headphones to save it with AI-generated key takeaways

Share
& Export

Send highlights to Twitter, WhatsApp or export them to Notion, Readwise & more

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode