0.10.3
New
- Metro now has experimental support for Kotlin 2.4.0. At the time of writing, this is only really helpful if you are testing IDE support in IntelliJ 2026.1 EAPs.
- Metro's compiler now embeds
androidx.tracingand can produce perfetto traces of its IR transformations. - [FIR]: Metro now does early detection of whether or not it's running in the IDE or CLI. If it's in the IDE, Metro will disable any FIR generators that do not generate user-visible code.
Enhancements
- [FIR]: When reporting diagnostics about types that are aliases, include the aliased type in the message. This is helpful for messages like below
typealias UserId = String interface Bindings { // error: Binds receiver type `kotlin.String` is the same type and qualifier as the bound type `UserId (typealias to kotlin.String)`. @Binds fun String.bind(): UserId }
- [FIR]: Add full integration tests for FIR-based IDE features.
- This is really only in the changelog because getting Android Studio to not show its blocking analytics consent dialog on CI might be the most difficult technical problem this project has faced so far and what's a changelog for if not the occasional itsfinallyover.gif bragging rights.
- [IR]: Use
androidx.collectionprimitive and scatter collections in a few more places to further help improve memory performance. - [IR]: Don't attempt to generate a graph impl if validation at any level in processing fails, as this could result in obscure extra errors getting reported after the relevant initial error.
Fixes
- [IR]: Avoid
IllegalStateException: No value parameter foundissues when reconstructing dependency cycle stacks to report cycle errors. - [IR]: Fix a scenario where bindings available in both graphs and their extensions didn't properly consolidate to one binding.
- [Gradle]: Make the
metrox-androidartifact single-variant (release only).
Changes
- [FIR/IR] Add aliases for a bunch of "known" mappings for Kotlin IDE plugin versions to Kotlin versions. This is still best-effort but should hopefully be more robust, especially in situations like Android Studio canaries (which do not report real Kotlin versions). Please star this issue: https://issuetracker.google.com/issues/474940910
- [FIR]: One downside of the above is that it revealed that Android Studio Otter 3 is effectively running on Kotlin 2.2.0, which is just a bit too far back to still support. However, now that Studio is switching to monthly releases it should track upstream IJ changes much quicker and Studio Panda is in RC1 now.
- Previously, an incompatible version could cause the IDE file analysis to hang or error out if IDE support was enabled. Now, Metro's IDE support will gracefully degrade on incompatible IDE versions. This includes Android Studio Otter and IntelliJ
2025.2.xas of this version. Android Studio Panda and IntelliJ 2025.3 are tested and working though!2026-02-08 01:14:27,225 [ 56672] INFO - STDERR - [METRO] Skipping enabling Metro extensions in IDE. Detected Kotlin version '2.2.255-dev-255' is not supported for IDE use (CLI_ONLY).
- Previously, an incompatible version could cause the IDE file analysis to hang or error out if IDE support was enabled. Now, Metro's IDE support will gracefully degrade on incompatible IDE versions. This includes Android Studio Otter and IntelliJ
- [IR]: Rework assisted inject bindings to be encapsulated by their consuming assisted factory bindings in graph validation.
- This ensures these classes can't accidentally participate in
SwitchingProviders or valid cycle breaking withDelegateFactory, as both of those requireProvidertypes and assisted-inject types' factories don't implementProvider.
- This ensures these classes can't accidentally participate in
- [Gradle]: Avoid deprecated
KotlinCompilation.implementationConfigurationNameAPI. enableTopLevelFunctionInjection,generateContributionHintsInFir, andsupportedHintContributionPlatformswill error if enabled on Kotlin/JS with JS incremental compilation enabled as it turns out this does not yet support generating top-level declarations from compiler plugins with incremental compilation enabled.- Fold
2.3.20-dev-7791compat into2.3.20-Beta2compat, meaning the former is no longer tested on CI. - Fold
2.3.20-dev-5437compat into2.3.20-dev-5706compat. This is to help Metro's main branch stay stable as the5437artifact came from a dev maven repo with ephemeral artifacts. - Test Kotlin
2.3.20-Beta2. - Test Kotlin
2.3.10. - Test Kotlin
2.4.0-dev-539. - Drop testing of Kotlin
2.3.10-RC. - Metro now compiles against Kotlin
2.3.0. This allows it to test2.4.0builds, but is still compatible down to Kotlin2.2.20. Metro's runtime artifacts also explicitly have their language version still set to2.2(and2.0for the Gradle plugin).
Contributors
Special thanks to the following contributors for contributing to this release!
What's Changed
- Small optimizations by @ZacSweers in #1753
- Rework how assisted-inject bindings are modeled by @ZacSweers in #1756
- Exit processing earlier if there are errors by @ZacSweers in #1759
- Update dependency androidx.work:work-runtime to v2.11.1 by @renovate[bot] in #1760
- Add sponsoring doc by @ZacSweers in #1763
- Add 2.3.20-Beta2 by @ZacSweers in #1761
- Update Gradle to v9.3.1 by @renovate[bot] in #1762
- Fix incorrect links in README.md by @DaniilPavlenko in #1764
- Gate FIR IDE support on bad studio versions by @ZacSweers in #1758
- Update dependency androidx.activity:activity-compose to v1.12.3 by @renovate[bot] in #1765
- Fix outdated README.md in metrox-viewmodel by @DaniilPavlenko in #1766
- Enable gradle parallel by @kevinguitar in #1768
- Add androidx tracing by @ZacSweers in #1767
- Improve alias diagnostics in FIR by @ZacSweers in #1773
- Update dagger to v2.59.1 by @renovate[bot] in #1779
- Update actions/checkout digest to de0fac2 by @renovate[bot] in #1778
- Add a functional test DSL by @ZacSweers in #1780
- Rework compat matching with aliases by @ZacSweers in #1781
- Update dependency com.google.googlejavaformat:google-java-format to v1.34.1 by @renovate[bot] in #1783
- Update dependency com.android.tools:r8 to v9 by @renovate[bot] in #1782
- IDE integration testing by @ZacSweers in #1784
- Update actions/download-artifact action to v7 by @renovate[bot] in #1786
- Update actions/setup-python action to v6 - autoclosed by @renovate[bot] in #1787
- Add graceful degredation for incompatible IDEs by @ZacSweers in #1788
- Fix/cycle reporter accuracy by @heorhiipopov in #1785
- Log trace file if enabled by @ZacSweers in #1789
- Migrate Renovate config by @renovate[bot] in #1790
- Fix inherited bindings duplicate binding error by @C2H6O in #1754
- Update dependency Markdown to v3.10.2 by @renovate[bot] in #1792
- Compile against 2.3.0 by @ZacSweers in #1791
- Kotlin 2.4.0 support + small fixes by @ZacSweers in #1794
- Update dependency org.jetbrains:annotations to v26 by @renovate[bot] in #1796
- Move wrapper cache to after by @ZacSweers in #1797
New Contributors
- @DaniilPavlenko made their first contribution in #1764
- @heorhiipopov made their first contribution in #1785
Full Changelog: 0.10.2...0.10.3