The Build Time Crisis That Almost Broke Meta's Android Team

The Build Time Crisis That Almost Broke Meta's Android Team

For years, Meta's Android engineers lived by Buck2's small module philosophy.

Keep modules tiny, let the build system handle parallelization, and everyone stays happy. But reality has a way of messing with perfect plans.Legacy code grew. Teams merged. What started as elegant 5-file modules turned into 50-file monsters that were choking the build pipeline. "Some critical modules now build up to 3x faster," Meta's Iveta Kovalenko wrote in today's engineering blog post.

That's not optimization

  • that's salvation for developers stuck waiting 20+ minutes for builds.### The Technical Deep Dive: Why This Actually MattersHere's where it gets interesting for anyone dealing with large Kotlin codebases.

Meta's team had to solve the same problems every Android shop hits when they scale up:The Shading Nightmare:

Kotlin's Build Tools API expects the shaded compiler (kotlin-compiler-embeddable), but Meta's toolchain used the unshaded version. Their first hack? Strip the org.jetbrains.kotlin prefix with jarjar and rebuild the library. Not pretty, but it worked. I've been down this same rabbit hole trying to integrate Kotlin incremental compilation with Gradle enterprise builds. You spend three days wrestling with compiler version conflicts, then discover the solution is literally renaming package prefixes with a 15-year-old Java tool. Software development is beautiful.Cache Relocation Hell: Buck2's distributed builds mean your compilation cache better work from anyone's machine, anywhere.

Meta had to explicitly configure root project and build directories to keep the incremental compiler from losing its mind across different environments.The Plugin Problem: Meta's custom compiler plugins weren't designed for incremental compilation.

When Kotlin only recompiles changed files, plugins that expect the full codebase fall apart. Meta's solution: make their plugins accumulate results across multiple compilation rounds instead of replacing them.### Why Developers Should Actually Care About ThisThis isn't just Meta solving Meta problems.

Every Android team hits the same walls:

  • Legacy module bloat:

That "quick feature" from 2019 is now a 200-file module taking 15 minutes to compile

  • Build cache misses: Change one file, wait for half the codebase to recompile
  • CI/CD bottlenecks: Pull requests sit in queue while builds crawl through unchanged code

Meta's approach shows there's a path forward that doesn't involve rewriting your entire build system. The Kotlin incremental compiler has been sitting there waiting

  • it just needed someone to do the integration work properly.### The Performance Numbers Don't LieA/B testing across Meta's codebase showed 30% improvement for the average developer. But here's the kicker
  • modules without annotation processing nearly doubled their speed. That's the difference between grabbing coffee and grabbing lunch while your build runs.The integration is rolling out internally now, with plans to bring it to Buck2's open source version soon. For teams stuck with slow Kotlin builds, this could be the breakthrough that makes large-scale Android development bearable again.Meta's Buck2 team proved that incremental compilation isn't just a nice-to-have feature
  • it's the difference between productive developers and developers who spend half their day waiting for builds.

Frequently Asked Questions

Q

How screwed are you if you're not using Buck2?

A

Pretty screwed if you're stuck with Gradle and massive Kotlin modules. Meta's solution is Buck2-specific, but the principles apply

  • incremental compilation works when your build system can preserve previous outputs and track changes intelligently.
Q

Is this coming to regular Android developers?

A

Maybe. Meta plans to bring this to Buck2's open source version, but most Android teams are married to Gradle. The real win here is proving that Kotlin's Build Tools API can work at scale

  • expect other build systems to follow.
Q

What about teams using KAPT instead of KSP2?

A

You're stuck in the slow lane. Meta's approach works because KSP2 runs independently from compilation. If you're still using KAPT, it runs as a compiler plugin during the main compilation step, which breaks incremental builds.

Q

Will this actually help with annotation processing?

A

KSP2 gets its own incremental processing for free. But if you're using other annotation processors, you're still waiting for the full non-incremental step before compilation even starts.

Q

How bad is the "shading nightmare" for other teams?

A

Anyone trying to integrate Kotlin's Build Tools API hits this. The shaded vs unshaded compiler mismatch causes java.lang.NoClassDefFoundError crashes. Meta's hack worked, but the real solution is migrating your entire toolchain to the shaded compiler.

Q

Does this fix the fundamental problem with large modules?

A

No, it makes them tolerable. The real fix is still breaking large modules into smaller ones. But when you're dealing with legacy code and team realities, 3x faster builds buy you time to do proper refactoring.

Q

What's the catch with distributed builds?

A

Your incremental compiler cache needs to be relocatable or you'll get conflicting overloads and ambiguity errors when builds run on different machines. Meta solved this with explicit path configuration, but it's another thing that can break.

Q

How much does this actually matter for CI/CD?

A

Huge impact. Pull requests that used to take 20+ minutes for compilation now finish in under 10. That's the difference between developers context-switching away and staying focused on their changes.

Related Tools & Recommendations

news
Similar content

Exabeam Wins Google Cloud DORA Award with 83% Lead Time Reduction

Cybersecurity leader achieves elite DevOps performance through AI-driven development acceleration

Technology News Aggregation
/news/2025-08-25/exabeam-dora-award
82%
news
Similar content

Meta's Celebrity AI Chatbot Clones Spark Lawsuits & Controversy

Turns Out Cloning Celebrities Without Permission Is Still Illegal

Samsung Galaxy Devices
/news/2025-08-30/meta-celebrity-chatbot-scandal
73%
news
Similar content

Docker Desktop Hit by Critical Container Escape Vulnerability

CVE-2025-9074 exposes host systems to complete compromise through API misconfiguration

Technology News Aggregation
/news/2025-08-25/docker-cve-2025-9074
73%
news
Similar content

Tenable Appoints Matthew Brown as CFO Amid Market Growth

Matthew Brown appointed CFO as exposure management company restructures C-suite amid growing enterprise demand

Technology News Aggregation
/news/2025-08-24/tenable-cfo-appointment
64%
news
Similar content

GitHub Copilot Agents Panel Launches: AI Assistant Everywhere

AI Coding Assistant Now Accessible from Anywhere on GitHub Interface

General Technology News
/news/2025-08-24/github-copilot-agents-panel-launch
64%
news
Similar content

Linux Foundation Takes Control of Solo.io AI Agent Gateway

Open source governance shift aims to prevent vendor lock-in as AI agent infrastructure becomes critical to enterprise deployments

Technology News Aggregation
/news/2025-08-25/linux-foundation-agentgateway
64%
news
Similar content

Docker Desktop CVE-2025-9074: Critical Host Compromise

CVE-2025-9074 allows full host compromise via exposed API endpoint

Technology News Aggregation
/news/2025-08-25/docker-desktop-cve-2025-9074
64%
news
Similar content

Verizon Outage: Service Restored After Nationwide Glitch

Software Glitch Leaves Thousands in SOS Mode Across United States

OpenAI ChatGPT/GPT Models
/news/2025-09-01/verizon-nationwide-outage
61%
news
Popular choice

Morgan Stanley Open Sources Calm: Because Drawing Architecture Diagrams 47 Times Gets Old

Wall Street Bank Finally Releases Tool That Actually Solves Real Developer Problems

GitHub Copilot
/news/2025-08-22/meta-ai-hiring-freeze
60%
news
Similar content

OpenAI Sora Released: Decent Performance & Investor Warning

After a year of hype, OpenAI's video generator goes public with mixed results - December 2024

General Technology News
/news/2025-08-24/openai-investor-warning
58%
news
Similar content

AGI Hype Fades: Silicon Valley & Sam Altman Shift to Pragmatism

Major AI leaders including OpenAI's Sam Altman retreat from AGI rhetoric amid growing concerns about inflated expectations and GPT-5's underwhelming reception

Technology News Aggregation
/news/2025-08-25/agi-hype-vibe-shift
58%
news
Similar content

eSIM Flaw Exposes 2 Billion Devices to SIM Hijacking

NITDA warns Nigerian users as Kigen vulnerability allows remote device takeover through embedded SIM cards

Technology News Aggregation
/news/2025-08-25/esim-vulnerability-kigen
58%
news
Similar content

Trump's 100% Chip Tariff Threat: What It Means for Your Phone

Donald Trump threatens a 100% chip tariff, potentially raising electronics prices. Discover the loophole and if your iPhone will cost more. Get the full impact

Technology News Aggregation
/news/2025-08-25/trump-chip-tariff-threat
58%
news
Similar content

Figma's Lukewarm Wall Street Reception & $37.6B Valuation

Major investment banks issue neutral ratings citing $37.6B valuation concerns while acknowledging design platform's AI integration opportunities

Technology News Aggregation
/news/2025-08-25/figma-neutral-wall-street
58%
news
Similar content

Windows 11 KB5063878 Breaks NDI Streaming Worldwide

KB5063878 causes severe lag and stuttering in live video production systems

Technology News Aggregation
/news/2025-08-25/windows-11-kb5063878-streaming-disaster
58%
tool
Popular choice

Python 3.13 - You Can Finally Disable the GIL (But Probably Shouldn't)

After 20 years of asking, we got GIL removal. Your code will run slower unless you're doing very specific parallel math.

Python 3.13
/tool/python-3.13/overview
57%
news
Similar content

ThingX Nuna AI Emotion Pendant: Wearable Tech for Emotional States

Nuna Pendant Monitors Emotional States Through Physiological Signals and Voice Analysis

General Technology News
/news/2025-08-25/thingx-nuna-ai-emotion-pendant
55%
news
Similar content

Tech Layoffs Hit 22,000 in 2025: AI Automation & Job Cuts Analysis

Explore the 2025 tech layoff crisis, with 22,000 jobs cut. Understand the impact of AI automation on the workforce and why profitable companies are downsizing.

NVIDIA GPUs
/news/2025-08-29/tech-layoffs-2025-bloodbath
55%
news
Similar content

Apple Sues Ex-Engineer for Apple Watch Secrets Theft to Oppo

Dr. Chen Shi downloaded 63 confidential docs and googled "how to wipe out macbook" because he's a criminal mastermind - August 24, 2025

General Technology News
/news/2025-08-24/apple-oppo-lawsuit
55%
news
Similar content

Tech Layoffs 2025: 22,000+ Jobs Lost at Oracle, Intel, Microsoft

Oracle, Intel, Microsoft Keep Cutting

Samsung Galaxy Devices
/news/2025-08-31/tech-layoffs-analysis
55%

Recommendations combine user behavior, content similarity, research intelligence, and SEO optimization