chore: pin cmake version (#19865)

On brand new ubuntu setup `make run-android` fails with :

```

Task :app:mergeExtDexDebug

FAILURE: Build failed with an exception.

What went wrong:
Execution failed for task ':react-native-reanimated:configureCMakeDebug[arm64-v8a]'.
[CXX1300] CMake '3.22.1' was not found in SDK, PATH, or by cmake.dir property.

BUILD FAILED in 2m 30s
673 actionable tasks: 673 executed

error: cannot unlink '/tmp/tmp-status-mobile-a094d218d/
nix-build-status-mobile-build-debug-android.drv-0/tmp.moQHI1tJWE/caches/8.4': Directory not empty
removed '/tmp/tmp-status-mobile-a094d218d/tmp.RpThXxcRZR'
make: *** [Makefile:278: run-android] Error 1
```

we do have `cmake` present in Android Shell and yet the build process is not able to find it.

This commit makes sure that we explicitly provide that reference.
This commit is contained in:
Siddarth Kumar 2024-05-03 13:52:26 +05:30 committed by GitHub
parent 7b9f4983cb
commit 25e3a56dba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 0 deletions

View File

@ -145,6 +145,14 @@ android {
jvmTarget = JavaVersion.VERSION_17
}
// https://developer.android.com/studio/projects/install-ndk#vanilla_cmake
externalNativeBuild {
cmake {
// This version must match cmakeVersions inside nix/pkgs/android-sdk/compose.nix
version "3.22.1"
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17

View File

@ -16,6 +16,7 @@ androidenv.composeAndroidPackages {
platformToolsVersion = "33.0.3";
buildToolsVersions = [ "34.0.0" ];
platformVersions = [ "34" ];
# This version must match cmake version inside android/app/build.gradle
cmakeVersions = [ "3.22.1" ];
ndkVersion = "25.2.9519653";
includeNDK = true;