Siddarth Kumar 25e3a56dba
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.
2024-05-03 13:52:26 +05:30

28 lines
827 B
Nix

#
# This Nix expression centralizes the configuration
# for the Android development environment.
#
{ androidenv, lib, stdenv }:
assert lib.assertMsg (stdenv.system != "aarch64-darwin")
"aarch64-darwin not supported for Android SDK. Use: NIXPKGS_SYSTEM_OVERRIDE=x86_64-darwin";
# The "android-sdk-license" license is accepted
# by setting android_sdk.accept_license = true.
androidenv.composeAndroidPackages {
cmdLineToolsVersion = "9.0";
toolsVersion = "26.1.1";
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;
includeExtras = [
"extras;android;m2repository"
"extras;google;m2repository"
];
}