Skip to content

fix: avoid implicit parent project property lookup deprecated in Gradle 9 - #2640

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 each plugin's android/build.gradle, once per variable the app sets in variables.gradle.

The plugins read 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.

108 lines in the 17 android/build.gradle files, all the same one-word change (project.hasProperty( to rootProject.hasProperty().

Same fix as ionic-team/capacitor#8731 for the core.

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

App: capacitor-testapp with all 17 plugins, each plugin's android/ linked to this branch. Gradle 9.8.2, ./gradlew assembleDebug --warning-mode all. variables.gradle sets minSdkVersion = 27 (plugin default 26) so the override is visible.

Before After
Warnings from these 17 plugins 108 0
Build successful successful

The 40 warnings left in the app come from plugins outside this repo (camera, filesystem, geolocation, haptics, keyboard, local-notifications), which get their own PRs.

App overrides still apply. An init script compared, for each of the 17 plugin projects, every ext value the plugin reads with the one in variables.gradle, plus the effective minSdk. There were no mismatches either before or after (minSdk=27 everywhere).

Platforms Affected

  • Android
  • iOS
  • Web

…le 9

The plugin build.gradle files 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.
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Released dev build of app-launcher with dev version: 9.0.0-dev-2640-20261119T161631.0

This was referenced Nov 19, 2026

@jcesarmobile jcesarmobile left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a few project. usages in two files we have in scripts/android/ folder for publishing.
Won't cause issues for users since they are only used for publishing, but we might need to update them once we move to Gradle 10.

@andredestro

andredestro commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor Author

There are a few project. usages in two files we have in scripts/android/ folder for publishing.

Thanks! A publish dry run with Gradle 9.8.2 shows no implicit lookup warnings from those scripts (project.plugins / project.getName() are API calls, and publishing runs with the plugin as the root project). It did flag the groupId / artifactId / version lines in publish-module.gradle, which use the no-= syntax that Gradle 10 removes. Same lines are in core and 9 of the plugin repos, so I opened RMET-5661 for it.

@andredestro
andredestro merged commit 503626a into next Nov 20, 2026
90 checks passed
@andredestro
andredestro deleted the fix/RMET-5591/gradle-implicit-property-lookup branch November 20, 2026 11:22
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