From d6a0bbec06fe8e69711697c6d25eecca5b93edb3 Mon Sep 17 00:00:00 2001 From: Andre Destro Date: Thu, 19 Nov 2026 16:41:00 +0000 Subject: [PATCH] fix(android): avoid implicit parent project property lookup deprecated 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. --- android/build.gradle | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 2d46d28..2d4b2ce 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,12 +1,12 @@ ext { capacitorVersion = System.getenv('CAPACITOR_VERSION') - junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2' - androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.8.0' - androidxCoreVersion = project.hasProperty('androidxCoreVersion') ? rootProject.ext.androidxCoreVersion : '1.19.1' - androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.7.0' - androidxExifInterfaceVersion = project.hasProperty('androidxExifInterfaceVersion') ? rootProject.ext.androidxExifInterfaceVersion : '1.4.2' - androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.3.0' - androidxMaterialVersion = project.hasProperty('androidxMaterialVersion') ? rootProject.ext.androidxMaterialVersion : '1.14.0' + junitVersion = rootProject.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2' + androidxAppCompatVersion = rootProject.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.8.0' + androidxCoreVersion = rootProject.hasProperty('androidxCoreVersion') ? rootProject.ext.androidxCoreVersion : '1.19.1' + androidxEspressoCoreVersion = rootProject.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.7.0' + androidxExifInterfaceVersion = rootProject.hasProperty('androidxExifInterfaceVersion') ? rootProject.ext.androidxExifInterfaceVersion : '1.4.2' + androidxJunitVersion = rootProject.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.3.0' + androidxMaterialVersion = rootProject.hasProperty('androidxMaterialVersion') ? rootProject.ext.androidxMaterialVersion : '1.14.0' } buildscript { @@ -34,10 +34,10 @@ if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { android { namespace = "com.capacitorjs.plugins.camera" - compileSdk = project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 37 + compileSdk = rootProject.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 37 defaultConfig { consumerProguardFiles "proguard-rules.pro" - minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 26 + minSdkVersion rootProject.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 26 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"