Repository navigation
fix(android): avoid implicit parent project property lookup deprecated in Gradle 9 - #154
Merged
Merged
Conversation
…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
requested review from
ItsChaceD,
OS-pedrogustavobilro,
alexgerardojacinto,
jcesarmobile,
markemer and
theproducer
November 19, 2026 16:40
jcesarmobile
approved these changes
Nov 19, 2026
andredestro
deleted the
fix/RMET-5591/gradle-implicit-property-lookup
branch
November 20, 2026 11:23
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 findsxby falling back to the root project, and that fallback is what Gradle deprecated. The value is already read fromrootProject, so this PR callshasProperty()there too. The behavior stays the same.8 lines in
plugin/android/build.gradle, all the same one-word change (project.hasProperty(torootProject.hasProperty(). Same fix as ionic-team/capacitor#8731 and ionic-team/capacitor-plugins#2640.Change Type
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.gradlesetsminSdkVersion = 27(plugin default 26) so the override is visible.App overrides still apply: an init script compared every
extvalue the plugin reads with the one invariables.gradle, plus the effectiveminSdk, with no mismatches before or after.Platforms Affected