diff --git a/devenv.nix b/devenv.nix index 972e2c44..61f3f63e 100644 --- a/devenv.nix +++ b/devenv.nix @@ -1,4 +1,4 @@ -{ pkgs, config, ... }: +{ pkgs, config, lib, ... }: { languages.javascript = { enable = true; @@ -12,7 +12,7 @@ android = { enable = true; platforms.version = [ "35" ]; - buildTools.version = [ "35.0.0" "35.0.1" ]; + buildTools.version = [ "34.0.0" "35.0.0" "35.0.1" ]; ndk.enable = true; ndk.version = [ "27.2.12479018" ]; cmake.version = [ ]; @@ -22,7 +22,8 @@ }; packages = with pkgs; [ git gh curl jq ripgrep python3 pkg-config gnumake gcc unzip zip ]; # Gradle's downloaded aapt2 cannot run directly on NixOS. - env.GRADLE_OPTS = "-Dorg.gradle.project.android.aapt2FromMavenOverride=${config.env.ANDROID_HOME}/build-tools/35.0.0/aapt2"; + # Keep API 35 aapt2 for phone builds even with Wear's older tools installed. + env.GRADLE_OPTS = lib.mkForce "-Dorg.gradle.project.android.aapt2FromMavenOverride=${config.env.ANDROID_HOME}/build-tools/35.0.0/aapt2"; # NativeScript's doctor rejects a valid build-only SDK without an emulator. # enterTest below checks the actual tools used by our local builds. env.NS_SKIP_ENV_CHECK = "1"; diff --git a/docs/development-nix.md b/docs/development-nix.md index 0a496a95..9cb52233 100644 --- a/docs/development-nix.md +++ b/docs/development-nix.md @@ -5,7 +5,7 @@ Install Nix with flakes and devenv, then run `devenv shell` in this directory The committed `devenv.lock` pins the environment inputs. The environment provides Node 22/npm, Java 21, Android SDK/platform 35, -build-tools 35.0.0/35.0.1 (app and NativeScript plugins), NDK 27, CMake, +build-tools 34.0.0 (Wear OS) and 35.0.0/35.0.1 (phone and NativeScript plugins), NDK 27, CMake, Git/GitHub CLI, Python and build utilities. `ANDROID_CMAKE_HOME` selects the Nix-patched CMake/Ninja pair for the native Android libraries (the SDK's bundled Ninja can crash on NixOS). Other environments keep using the SDK's CMake. diff --git a/scripts/check-devenv.sh b/scripts/check-devenv.sh index 0cfbe539..3caf9c34 100644 --- a/scripts/check-devenv.sh +++ b/scripts/check-devenv.sh @@ -4,7 +4,7 @@ set -euo pipefail node --version java -version test -f "$ANDROID_HOME/platforms/android-35/android.jar" -for version in 35.0.0 35.0.1; do +for version in 34.0.0 35.0.0 35.0.1; do "$ANDROID_HOME/build-tools/$version/aapt2" version done "$ANDROID_HOME/platform-tools/adb" version