Telegram

AGP THE WHEEL OF DOOM

AGP: The Wheel of Doom

In the ever-evolving world of Android development, the Android Gradle Plugin (AGP) has become both a cornerstone and a source of relentless frustration for developers. While it promises to streamline the build process, its frequent updates and breaking changes have turned it into what many developers affectionately (or not so affectionately) call the “Wheel of Doom.” This article delves into the challenges posed by AGP, the ripple effects on the broader Android ecosystem, and why a more stable, predictable approach is urgently needed.

The Breaking Point: Why AGP Updates Feel Like a Curse

For years, developers have grappled with the seemingly endless cycle of AGP updates. Each new version, while introducing shiny new features, often comes with a host of breaking changes that require significant rework. The problem isn’t just the frequency of these updates—it’s the lack of thorough testing before release. Developers are left to play the role of beta testers, discovering issues only after the update has been pushed to production. This reactive approach has led to countless hours wasted on debugging and workarounds, time that could have been spent on actual feature development.

The issue is compounded by the fact that AGP is feature-plagued. With so many interactions and configurations possible, it’s nearly impossible to test every scenario. Yet, Google continues to rewrite the plugin from the ground up every year or so, introducing new methods that claim to do “roughly the same thing” as their predecessors but often fall short in practice. This leaves plugin developers in tears, forced to “wing it” and hope for the best.

Kotlin Integration: A Double-Edged Sword

One of the most contentious changes in recent AGP updates has been the embedding of Kotlin. While the intention was to make AGP developers more comfortable and reduce the need to maintain compatibility with Kotlin, the reality has been far from ideal. Embedding Kotlin has created a cascade of issues, putting immense strain on the Kotlin team and Gradle to bundle the most recent versions of everything everywhere.

For developers, the problems are even more pronounced. Embedding Kotlin has made it nearly impossible to migrate off deprecated Kotlin plugins, and testing new Kotlin compilers has become a nightmare—especially in the Android ecosystem. The result is a fragmented development experience where developers are left to navigate a labyrinth of compatibility issues and deprecated features.

The KTS Conundrum: Scripting in Build Files

The introduction of Kotlin Script (KTS) was meant to simplify the configuration of Android builds. However, it has introduced a whole new set of challenges. Developers have started programming and scripting in configuration files, turning what should be a straightforward process into a complex, error-prone endeavor. Projects using buildSrc with Kotlin files defining and configuring the project have become increasingly common, but they come with their own set of headaches.

For instance, developers often need to guess and typecast Task types, leading to a frustrating experience where the build configuration is either incomplete or riddled with errors. The promise of code completion, which was supposed to be the primary benefit of KTS, has been overshadowed by the complexity it introduces. In contrast, web development has managed to keep configuration files simple and easy to use, often relying on JSON schema for code completion. Why can’t Android development take a page from this playbook?

The Call for Stability: Project Marble for AGP

The time has come for the AGP team to take a page from Google’s own playbook and embark on a “Project Marble” for AGP. Just as Project Marble stabilized the Android platform, AGP needs a similar initiative to stabilize its API and provide migration paths for every single public removed method or task. This would not only reduce the burden on developers but also allow them to focus on what truly matters: building great apps and elevating their products.

The current state of AGP is unsustainable. Developers are fed up with wasting weeks finding workarounds for issues that could have been avoided with better planning and testing. The constant churn of breaking changes and the lack of clear migration paths have turned AGP into a productivity killer. It’s time for Google to prioritize stability and developer experience over the relentless pursuit of new features.

A Path Forward: What Needs to Change

To address the challenges posed by AGP, several key changes are needed:

  1. Thorough Testing Before Release: AGP updates should undergo rigorous testing to ensure that breaking changes are minimized and well-documented. Beta programs should be expanded to include more real-world scenarios.

  2. Stable API: The AGP team should commit to stabilizing the API and providing clear migration paths for deprecated features. This would reduce the burden on developers and plugin maintainers.

  3. Simplified Configuration: The introduction of KTS should be accompanied by tools and documentation that make it easier to use. Alternatively, Google should consider adopting a simpler configuration format, similar to JSON schema used in web development.

  4. Better Collaboration: Google should work more closely with the developer community to identify pain points and address them proactively. This could involve regular feedback sessions, surveys, and open channels for communication.

  5. Focus on Developer Experience: Above all, the AGP team should prioritize the developer experience. This means reducing the cognitive load on developers and ensuring that updates enhance productivity rather than hinder it.

Conclusion: Breaking the Wheel of Doom

The Android Gradle Plugin has the potential to be a powerful tool for developers, but its current trajectory is unsustainable. The constant churn of breaking changes, the complexity of Kotlin integration, and the challenges posed by KTS have turned it into a source of frustration rather than a productivity booster. It’s time for Google to take a step back, reassess its priorities, and commit to a more stable, developer-friendly approach.

By stabilizing the API, improving testing, and simplifying configuration, Google can break the “Wheel of Doom” and restore AGP to its rightful place as a cornerstone of Android development. The developer community is ready and willing to embrace these changes, but it’s up to Google to lead the way. The future of Android development depends on it.

Explore More
Redirecting in 20 seconds...