Fix gradle aapt2 linking
build / build (push) Failing after 2m56s

This commit is contained in:
2026-06-12 19:05:03 +02:00
parent 184f7b3b4c
commit 32e45c266d
4 changed files with 29 additions and 19 deletions
+8 -5
View File
@@ -20,11 +20,14 @@ This is a lab project (`lab` skill conventions apply) EXCEPT:
## NixOS aapt2 workaround
AGP cannot run the Maven-downloaded aapt2 on NixOS (dynamically linked
generic Linux binary). The nix shellHook rewrites the
`android.aapt2FromMavenOverride` line in `gradle.properties` to point at
the SDK's nix-patched aapt2 on every `nix develop`. The sentinel value
`__NIX_SHELLHOOK_SETS_THIS__` is what's tracked in git; the shellHook
replaces it before any gradle command runs.
generic Linux binary). The flake's dev shell ships a wrapped `gradle` that
always passes `-Dorg.gradle.project.android.aapt2FromMavenOverride=<sdk
aapt2>` on the command line; Gradle turns `org.gradle.project.*` system
props into project properties, which is what AGP reads. It must be a CLI
arg: the nixpkgs-25.11 gradle wrapper ignores `GRADLE_OPTS` (fixed
post-25.11, nixpkgs PR #449037 — the flake wrapper can be dropped once
the pin moves past 25.11). No file rewriting; `gradle.properties` stays
untouched.
## Commands (user-run, from repo root)