Hi folks
I’m running Gradle in a Windows 11 environment where I don’t have an admin account, and I don’t have permission to run executables that aren’t in Program Files.
This is an issue, because there’s a step in my build where Gradle seems to compile a .jar into an .exe on the fly and try to run it, and the build fails.
If i run gradle build --stacktrace
, there’s a line near the bottom that says:
Caused by: java.io.IOException: Cannot run program "C:\Users\<my name>\.gradle\caches\transforms-3\d2e13ce933dc46ad7688d7cb7c2ae8e0\transformed\aapt2-7.1.2-7984345-windows\aapt2.exe": CreateProcess error=1260, This program is blocked by group policy. For more information, contact your system administrator
which is the normal error I get when I try to run an exe.
The frustrating thing is, I have the Android SDK commandline tools installed, and aapt2.exe is already available on the path. So I’m not sure why Gradle needs to go out of it’s way to make a new one in my home directory.
Is there any way I can tell Gradle to use the Android SDK’s aapt2.exe? Or just use the original aapt2 Jar with the Java installation I also have on the path?
I’d like not to have to get into a fight with my IT group about whitelisting random executables in my home folder.