Repository navigation
fix: avoid implicit parent project property lookup deprecated in Gradle 9 - #2640
Conversation
…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.
|
Released dev build of app-launcher with dev version: 9.0.0-dev-2640-20261119T161631.0 |
jcesarmobile
left a comment
There was a problem hiding this comment.
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.
Thanks! A publish dry run with Gradle 9.8.2 shows no implicit lookup warnings from those scripts ( |
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 invariables.gradle.The plugins read 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.108 lines in the 17
android/build.gradlefiles, all the same one-word change (project.hasProperty(torootProject.hasProperty().Same fix as ionic-team/capacitor#8731 for the core.
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
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.gradlesetsminSdkVersion = 27(plugin default 26) so the override is visible.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
extvalue the plugin reads with the one invariables.gradle, plus the effectiveminSdk. There were no mismatches either before or after (minSdk=27everywhere).Platforms Affected