From 167a5df7f111085a464c3182bb4361dbc44e50af Mon Sep 17 00:00:00 2001 From: Andre Destro Date: Thu, 19 Nov 2026 16:18:48 +0000 Subject: [PATCH] fix: avoid implicit parent project property lookup deprecated in Gradle 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. --- .../android/build.gradle.mustache | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/assets/plugin-template/android/build.gradle.mustache b/assets/plugin-template/android/build.gradle.mustache index c6493e5..5a532db 100644 --- a/assets/plugin-template/android/build.gradle.mustache +++ b/assets/plugin-template/android/build.gradle.mustache @@ -1,16 +1,16 @@ ext { - junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2' - androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.1' - androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.3.0' - androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.7.0' + junitVersion = rootProject.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2' + androidxAppCompatVersion = rootProject.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.1' + androidxJunitVersion = rootProject.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.3.0' + androidxEspressoCoreVersion = rootProject.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.7.0' {{ #KOTLIN }} - androidxCoreKTXVersion = project.hasProperty('androidxCoreKTXVersion') ? rootProject.ext.androidxCoreKTXVersion : '1.17.0' + androidxCoreKTXVersion = rootProject.hasProperty('androidxCoreKTXVersion') ? rootProject.ext.androidxCoreKTXVersion : '1.17.0' {{ /KOTLIN }} } buildscript { {{ #KOTLIN }} - ext.kotlin_version = project.hasProperty("kotlin_version") ? rootProject.ext.kotlin_version : '2.2.20' + ext.kotlin_version = rootProject.hasProperty("kotlin_version") ? rootProject.ext.kotlin_version : '2.2.20' {{ /KOTLIN }} repositories { google() @@ -31,10 +31,10 @@ apply plugin: 'kotlin-android' android { namespace = "{{ PACKAGE_ID }}" - compileSdk = project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 36 + compileSdk = rootProject.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 36 defaultConfig { - minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 24 - targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 36 + minSdkVersion rootProject.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 24 + targetSdkVersion rootProject.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 36 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"