diff --git a/packages/app/modules/paseo-diff-prototype/android/build.gradle b/packages/app/modules/paseo-diff-prototype/android/build.gradle index f218c03ef8..3f717f4de4 100644 --- a/packages/app/modules/paseo-diff-prototype/android/build.gradle +++ b/packages/app/modules/paseo-diff-prototype/android/build.gradle @@ -12,6 +12,7 @@ useDefaultAndroidSdkVersions() def skiaPackage = new File(["node", "--print", "require.resolve('@shopify/react-native-skia/package.json')"].execute(null, projectDir).text.trim()).parentFile android { + ndkVersion rootProject.ext.ndkVersion namespace "sh.paseo.diffprototype" defaultConfig { externalNativeBuild { diff --git a/packages/app/scripts/verify-android-ndk.gradle b/packages/app/scripts/verify-android-ndk.gradle new file mode 100644 index 0000000000..a53a5406bb --- /dev/null +++ b/packages/app/scripts/verify-android-ndk.gradle @@ -0,0 +1,22 @@ +// After Expo prebuild, run from packages/app/android: +// ./gradlew --init-script ../scripts/verify-android-ndk.gradle verifyAndroidNdk +gradle.projectsEvaluated { + rootProject.tasks.register('verifyAndroidNdk') { + doLast { + def expected = rootProject.ext.ndkVersion + def nativeProjects = rootProject.subprojects.findAll { subproject -> + def android = subproject.extensions.findByName('android') + android != null && (android.externalNativeBuild.cmake.path != null || + android.externalNativeBuild.ndkBuild.path != null) + } + assert !nativeProjects.empty : 'No native Android modules found' + println "Project NDK: ${expected}" + def mismatches = nativeProjects.findAll { subproject -> + def actual = subproject.android.ndkVersion + println "${subproject.path} NDK: ${actual}" + actual != expected + } + assert mismatches.empty : "Native Android modules must use project NDK ${expected}: ${mismatches*.path}" + } + } +} diff --git a/patches/react-native-unistyles+3.2.4.patch b/patches/react-native-unistyles+3.2.4.patch index 25324c6218..0195868340 100644 --- a/patches/react-native-unistyles+3.2.4.patch +++ b/patches/react-native-unistyles+3.2.4.patch @@ -317,3 +317,15 @@ index 39e0d9d..a21ba95 100644 this.stylesCache.clear() this.dependenciesMap.clear() this.disposeListenersMap.clear() +diff --git a/node_modules/react-native-unistyles/android/build.gradle b/node_modules/react-native-unistyles/android/build.gradle +index 195954b..c4ac28c 100644 +--- a/node_modules/react-native-unistyles/android/build.gradle ++++ b/node_modules/react-native-unistyles/android/build.gradle +@@ -38,6 +38,7 @@ if (isNewArchitectureEnabled()) { + + android { + compileSdkVersion safeExtGet('compileSdkVersion', 35) ++ ndkVersion safeExtGet('ndkVersion', '27.1.12297006') + namespace "com.unistyles" + + defaultConfig {