diff --git a/app/gradle.properties b/app/gradle.properties
index cd0519bb2a9450033b80e5906f766b71d176014f..6743e4c3e5adf77f974be5bdb2ee07f3719e80fe 100644
--- a/app/gradle.properties
+++ b/app/gradle.properties
@@ -20,4 +20,12 @@ kotlin.code.style=official
 # Enables namespacing of each library's R class so that its R class includes only the
 # resources declared in the library itself and none from the library's dependencies,
 # thereby reducing the size of the R class for that library
-android.nonTransitiveRClass=true
\ No newline at end of file
+android.nonTransitiveRClass=true
+
+# What an atrocious path, you say.  Well, yes.  It doesn't make a ton of sense
+# to have this checked in.  However, it seems like the other properties here
+# should be checked in and also this setting seems to *have* to go in this
+# file (instead of, say, local.properties).  The devShell provided by the
+# flake will rewrite this path at activation time if it needs to be different!
+# So maybe focus on bigger problems for a while.
+android.aapt2FromMavenOverride=/nix/store/n7mv52lj2alq2gkys0skwwgs6c7s1cyl-androidsdk/libexec/android-sdk/build-tools/31.0.0/aapt2
diff --git a/flake.nix b/flake.nix
index 5cc5a42da1af65598246631cf4657797fd13fa9c..a5b93c9fdc5f5d6ad974dede5763cc51513e1661 100644
--- a/flake.nix
+++ b/flake.nix
@@ -166,6 +166,8 @@
 
         sdk.dir=${ANDROIDSDK}
 
+        sed -i -e s,aapt2FromMavenOverride=.*,aapt2FromMavenOverride=${ANDROIDSDK}/build-tools/${buildToolsVersion}/aapt2, app/gradle.properties
+
         # This probably needs to be set somewhere, but perhaps not here?
         #
         # > [CXX5106] NDK was located by using ndk.dir property. This method
@@ -176,14 +178,6 @@
         # android.ndkVersion=${ndkVersion}
         EOF
         '';
-
-        # cat >app/app/gradle.properties <<EOF
-        # # THIS FILE IS AUTOMATICALLY GENERATED
-        # # DO NOT EDIT
-        # # YOUR CHANGES WILL BE DESTROYED
-
-        # android.aapt2FromMavenOverride=${ANDROIDSDK}/build-tools/30.0.3/aapt2
-        # EOF
       };
 
       devShells.default = self.devShells.${system}.gradle;