From 204107fb38a030baa20ff05784ea06dc9eac8643 Mon Sep 17 00:00:00 2001 From: Ammar Ahmed Date: Wed, 5 Aug 2026 19:12:40 +0500 Subject: [PATCH] mobile: pin ndkVersion for all android sub projects. --- apps/mobile/android/build.gradle | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/apps/mobile/android/build.gradle b/apps/mobile/android/build.gradle index ffe8d392c..b53557aaa 100644 --- a/apps/mobile/android/build.gradle +++ b/apps/mobile/android/build.gradle @@ -41,3 +41,23 @@ allprojects { maven { url 'https://www.jitpack.io' } } } + +/** + * Pin every Android module to the NDK this project declares above. + * + * Most native modules already honour rootProject's ndkVersion, but a module that has an + * externalNativeBuild and never sets ndkVersion on its android extension silently falls back to + * whatever NDK the Android Gradle Plugin defaults to. That default is a different version than the + * one we pin, so the build then demands an NDK nobody asked for and fails at configuration time + * with "[CXX1101] NDK at .../ did not have a source.properties file" if it isn't installed + * (or is a partial install). react-native-nitro-cloud-uploader is one such module. + * + * Setting it here keeps every module on a single NDK regardless of what each one declares. + */ +subprojects { subproject -> + ["com.android.application", "com.android.library"].each { pluginId -> + subproject.plugins.withId(pluginId) { + subproject.android.ndkVersion = rootProject.ext.ndkVersion + } + } +}