Are there any Android app developers who find themselves sighing, “The build is taking forever…” during development? In modern Android app development, Gradle continues to hold its place as an indispensable build tool. Yet the Android Gradle Plugin (AGP) and Kotlin Gradle Plugin are constantly evolving, and keeping up with their changes can be a heavy burden for many developers. As a result, some teams struggle to allocate time for build optimization and acceleration, leading to inefficiencies in day-to-day development. We also hear concerns that `build.gradle` files written with outdated knowledge may no longer align with current best practices, leaving developers hesitant to refactor them. Gradle forms the foundation of sophisticated build processes, and new features such as the Kotlin DSL and Configuration Cache have further unlocked its potential. At the same time, Android development has welcomed innovations like multi-module architectures, Jetpack Compose, and Kotlin Multiplatform, requiring developers to keep their knowledge continuously up-to-date. Given today’s environment, it is understandable that the internal workings of Gradle and AGP feel opaque. This stems from an incomplete grasp of each tool’s life cycle and how the two integrate. Based on firsthand experience wrestling with Gradle and AGP, this session aims to answer those questions and challenges. Specifically, we will go over the life cycles of Gradle and AGP in detail and clarify how AGP integrates into Gradle’s life cycle. Building on that foundation, we will share concrete design guidelines for fully leveraging powerful caching mechanisms such as the Gradle Build Cache and Configuration Cache, introduce efficiency techniques for multi-module projects, and highlight common anti-patterns along with ways to avoid them. Let’s graduate from blankly staring at Gradle logs, cut down build-time stress, and focus on what truly matters: developing great apps! Planned Talk Content Gradle & AGP Life Cycles 1. Overview of each life cycle - Gradle’s initialization, configuration, and execution phases - AGP’s initialization, sync, and task-execution phases - What happens in each phase and how to use APIs and extensions 2. How understanding the life cycle leads to optimization - Typical bottlenecks in each phase and their causes - API usage strategies that respect the life cycle Caching Mechanisms for Faster Builds 1. Gradle Build Cache: mechanism and best practices - How the Build Cache reuses build outputs - Settings and recommendations to enable it effectively 2. Configuration Cache: characteristics and adoption tips - Requirements and configuration to enable the cache - Common issues during rollout and how to solve them 3. Common anti-patterns that disable caches and how to avoid them - Effects of dynamic dependencies and improper task input/output declarations - Code examples that unintentionally disable caching and how to fix them Efficient Module Architecture & Dependency Management 1. Module partitioning with cache efficiency and parallelism in mind - Strategies for dividing modules by feature or responsibility - How inter-module dependencies impact build time and cache efficiency - Design considerations for dependency direction and visibility - Effective module management techniques in large projects - Proper use of dependency scopes (Translated by the DroidKaigi Committee)
RyuNen344 Android App Developer
- Developers who feel uneasy about Gradle - Anyone eager to speed up their builds - Those who want to catch up on the latest Gradle & AGP features - Developers aiming to create life-cycle-aware Gradle plugins
Hybrid Mobile Apps with Compose Multiplatform and SwiftUI: Practical Code Sharing and UI Integration
Yena Hwang
#App Architecture
Nasty Dependencies: Surviving and fixing bugs in 3rd-party libraries
Yury
#Development Tools and Services
Challenges developing an Android based system for 2-wheel vehicles
Luke Carwardine
#Android Platform