@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user