Skip to content

fix(android): avoid implicit parent project property lookup deprecated in Gradle 9 - #103

Merged
andredestro merged 1 commit into
nextfrom
fix/RMET-5591/gradle-implicit-property-lookup
Nov 20, 2026
Merged

andredestro merged 1 commit into
nextfrom
fix/RMET-5591/gradle-implicit-property-lookup

Conversation

@andredestro

@andredestro andredestro commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Description

On Gradle 9.8, an app gets "Implicit lookup of properties in parent projects has been deprecated. This will fail with an error in Gradle 10." from this plugin's Android build file, once per variable the app sets in variables.gradle.

The plugin reads overrides with project.hasProperty('x') ? rootProject.ext.x : default. Called on the plugin subproject, hasProperty() only finds x by falling back to the root project, and that fallback is what Gradle deprecated. The value is already read from rootProject, so this PR calls hasProperty() there too. The behavior stays the same.

7 lines in android/build.gradle, all the same one-word change (project.hasProperty( to rootProject.hasProperty(). Same fix as ionic-team/capacitor#8731 and ionic-team/capacitor-plugins#2640.

Change Type

  • Fix
  • Feature
  • Refactor
  • Breaking Change
  • Documentation
  • Other (CI, chores, etc.)

Rationale / Problems Fixed

Fixes RMET-5591
Reference: https://docs.gradle.org/9.8.2/userguide/upgrading_version_9.html#deprecated_implicit_lookup_in_parent_projects

Tests or Reproductions

Capacitor 9 app (Gradle 9.8.2, AGP 9.4.1) with this branch's Android project included, ./gradlew help --warning-mode all. variables.gradle sets minSdkVersion = 27 (plugin default 26) so the override is visible.

Before After
Warnings from this plugin 6 0

App overrides still apply: an init script compared every ext value the plugin reads with the one in variables.gradle, plus the effective minSdk, with no mismatches before or after.

Platforms Affected

  • Android
  • iOS
  • Web

…d in Gradle 9

The build.gradle read app overrides with
project.hasProperty('x') ? rootProject.ext.x : default. hasProperty() on a
subproject only finds the value by falling back to the root project, which
Gradle 9 deprecates and Gradle 10 will turn into an error.

Call hasProperty() on rootProject instead, which is where the value is read
from anyway.
@andredestro
andredestro merged commit 9845180 into next Nov 20, 2026
4 checks passed
@andredestro
andredestro deleted the fix/RMET-5591/gradle-implicit-property-lookup branch November 20, 2026 11:25
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.

3 participants