Skip to content

RDMR-1420 Adopt Gradle 9 / AGP 9 and target API 37 - #39

Merged
EiyuuZack merged 5 commits into
outsystems/15.1.xfrom
feat/RDMR-1420/agp9
Aug 11, 2026
Merged

RDMR-1420 Adopt Gradle 9 / AGP 9 and target API 37#39
EiyuuZack merged 5 commits into
outsystems/15.1.xfrom
feat/RDMR-1420/agp9

Conversation

@EiyuuZack

@EiyuuZack EiyuuZack commented Aug 5, 2026

Copy link
Copy Markdown

This moves the fork's build stack to Gradle 9.5.1 / AGP 9.2.1 / build-tools 37.0.0 / SDK 37 (Android 17) so generated apps can target API 37. AGP ≥ 9.1 is the floor for API 37 and AGP 8.x does not run on Gradle 9, so the toolchain moves in one coupled jump; the chosen versions match the Capacitor 9 stack so cross-framework plugins validate against a single toolchain. MABS 13 ships AGP 9 / Gradle 9 exclusively, so the stack carries no AGP < 9 support.

It adds 5 commits:

  • Remove the Kotlin Gradle Plugin wiring — AGP 9 ships built-in Kotlin and hard-fails when the standalone kotlin-android plugin is applied. GradlePluginKotlinEnabled (including plugin.xml-injected preferences, e.g. FCM and InAppBrowser) degrades to an informational log line, and plugin Kotlin sources compile with no KGP at all.
  • Write AGP 9 compatibility flags on prepareandroid.newDsl=false and android.defaults.buildfeatures.resvalues=true are written into every generated project, keeping legacy variant API / old DSL and resValue plugin gradle code building (the FCM google-services:4.3.14 chain depends on the former).
  • Fix the test/androidx proguard reference — proguard-android.txt is a configure-time hard error under AGP 9, and that project builds in CI against the new defaults.
  • Bump the defaults json to Gradle 9.5.1 / AGP 9.2.1 / SDK 37 / build-tools 37.0.0 / Kotlin 2.2.20 (bare projects and framework builds; template preferences still override).
  • Drop the obsolete Wrapper.validateDistributionUrl workaround — it only matched Gradle 8.6–8.7 (broken by Avoid file generation with gradle init when dialog is cancelled gradle/gradle#27408, restored in 8.8 by Restore providing convention for Wrapper.validateDistributionUrl gradle/gradle#28719); upstream never carried it, so the wrapper task returns to upstream's exact form.

A few consequences worth a closer look in review:

  • Kotlin versioning becomes AGP-driven: plugin Kotlin is compiled by AGP's bundled KGP 2.2.10 (K2) regardless of GradlePluginKotlinVersion, which no longer wires anything. This is a policy change to surface in release notes.
  • Both compatibility flags are removed in AGP 10 — they are a transition bridge for plugin gradle code; the plugin remediation backlog is tracked outside this PR with the AGP 10 adoption (API 38 / MABS 14 cycle) as the deadline.
  • Configurations pinning AGP below 9 are not supported by this fork line: build-tools < 37 fail the min-check, and Kotlin plugin code would not compile (no KGP wiring). Deliberate: MABS 13 is AGP 9 / SDK 37 only.
  • cordova requirements android does not recognize the dotted platforms;android-37.0 package (same as upstream Unable to target Android API Level 37 - requirements check fails due to 37.0 vs. 37 apache/cordova-android#1982). Builds are unaffected — the target check is only reachable through the requirements API — and the fix is tracked separately.

Upstream has no AGP 9 / Gradle 9 work (master remains on Gradle 8.14.2 / AGP 8.10.1), so this takes the fork ahead of upstream. Validated with debug APK + release AAB builds from the NativeShell template at API 37 (aapt2 badging verified), hostile plugin probes (Kotlin sources dex-verified; variant-API and google-services chains exercised with and without the flags), and the fork's JS + Java test suites on the new defaults.

@EiyuuZack
EiyuuZack force-pushed the feat/RDMR-1420/agp9 branch 2 times, most recently from 5972659 to 171ca56 Compare August 5, 2026 11:21
@EiyuuZack
EiyuuZack requested review from a team, Chuckytuh, OS-kepatotorica, OS-ruialves, benmccarty91, trevor-lambert and usernuno and removed request for a team August 5, 2026 11:51
@EiyuuZack EiyuuZack self-assigned this Aug 5, 2026
AGP 9 ships built-in Kotlin and hard-fails when the standalone
kotlin-android plugin is applied, and MABS 13 ships no AGP < 9, so the
KGP wiring — the apply, both classpath entries, kotlinOptions and the
explicit stdlib dependency — is removed outright rather than gated.
GradlePluginKotlinEnabled (including plugin.xml-injected preferences,
e.g. FCM and InAppBrowser) degrades to an informational log line;
built-in Kotlin compiles plugin sources with no wiring at all.

References https://outsystemsrd.atlassian.net/browse/RDMR-1420
AGP 9 flips defaults that break common plugin gradle code: the legacy
variant API and old DSL types are hidden, and resValue declarations
stop working. Customer plugins can't be migrated from here, so prepare
bridges both behaviors (android.newDsl=false and the resvalues build
feature) into every generated gradle.properties — unconditionally,
since the stack is AGP 9-only under MABS 13. Both properties are
removed in AGP 10, bounding the transition window.

References https://outsystemsrd.atlassian.net/browse/RDMR-1420
getDefaultProguardFile('proguard-android.txt') throws at configuration
time under AGP 9, regardless of minifyEnabled. The androidx test
project builds in CI against the defaults json, so the reference must
move to proguard-android-optimize.txt before those defaults flip to 9.

References https://outsystemsrd.atlassian.net/browse/RDMR-1420
API 37 requires AGP >= 9.1, and the AGP 9.2.1 / Gradle 9.5.1 /
build-tools 37.0.0 / Kotlin 2.2.20 combination matches the Capacitor 9
stack so cross-framework plugins validate against a single toolchain.
These defaults govern bare projects and the framework's own builds;
template preferences still override them for customer apps.

References https://outsystemsrd.atlassian.net/browse/RDMR-1420
@EiyuuZack
EiyuuZack force-pushed the feat/RDMR-1420/agp9 branch from 1d08582 to 9e01fe1 Compare August 7, 2026 16:50
Gradle 8.6 stopped providing the convention for
Wrapper.validateDistributionUrl (gradle/gradle#27408), which made
custom Wrapper-typed tasks fail validation unless the property was set
explicitly. Gradle 8.8 restored the convention (gradle/gradle#28719),
the stack is now on 9.5.1, and upstream never carried the property —
the workaround only matched Gradle 8.6-8.7.

References https://outsystemsrd.atlassian.net/browse/RDMR-1420
@EiyuuZack
EiyuuZack merged commit 626c0ba into outsystems/15.1.x Aug 11, 2026
15 checks passed
@EiyuuZack
EiyuuZack deleted the feat/RDMR-1420/agp9 branch August 11, 2026 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants