Repository navigation
fix: avoid implicit parent project property lookup deprecated in Gradle 9 - #157
Closed
andredestro wants to merge 1 commit into
Closed
andredestro wants to merge 1 commit into
andredestro wants to merge 1 commit into
Conversation
…le 9
The template's 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:18
alexgerardojacinto
approved these changes
Nov 19, 2026
Member
|
I'll cover this in RMET-4847, some of the replacements you did will mess with migrate-capacitor-plugin as some of the lines you updated are going to be removed or renamed and this changes will make the existing regular expressions or strings not match. |
jcesarmobile
deleted the
fix/RMET-5591/gradle-implicit-property-lookup
branch
November 19, 2026 18:01
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
New plugins now call
hasProperty()onrootProjectinstead ofprojectwhen reading app overrides (junitVersion,compileSdkVersion,kotlin_version, etc.). On Gradle 9.8, the old form makes every app that sets these invariables.gradleshow "Implicit lookup of properties in parent projects has been deprecated. This will fail with an error in Gradle 10." for the plugin. The value is already read fromrootProject, so the behavior is the same.9 lines in
build.gradle.mustache, including the Kotlin-onlyandroidxCoreKTXVersionandkotlin_versionlines. Same fix as ionic-team/capacitor#8731 and ionic-team/capacitor-plugins#2640.Tested by generating a Java and a Kotlin plugin with this branch and adding them to a Capacitor 9 app (Gradle 9.8.2, AGP 9.4.1) whose
variables.gradlesets values that differ from the template defaults:The Java plugin builds (
assembleDebug) and picks up the app's values:compileSdk=37(template default 36),minSdk=27(template default 24).The Kotlin plugin fails to build, before and after this change, with
Failed to apply plugin 'kotlin-android'. Cannot add extension with name 'kotlin'. AGP 9 has built-in Kotlin support and the template still applieskotlin-android. That is a separate issue and not part of this PR. The warnings counted above are the ones raised before evaluation stops, which include the two Kotlin-only lines.Change Type
Rationale / Problems Fixed
https://outsystemsrd.atlassian.net/browse/RMET-5591
https://docs.gradle.org/9.8.2/userguide/upgrading_version_9.html#deprecated_implicit_lookup_in_parent_projects
Platforms Affected