Unable to package for Android after upgrading from 4.23.2 to 4.24.2

So yeah, I just discovered the answer myself, but I’ll post it here for anyone else having the same issue:

I opened cmd.exe and navigated here: “[Project folder]\Intermediate\Android\APK\gradle” and executed “rungradle.bat :app:assembleDebug --stacktrace”. Now I could see the reason for the exception. It was a heap size exception. Turns out that I have a environment variable in Windows called _JAVA_OPTIONS with value “-Xms256m -Xmx512m” (as can be seen in the output logs). This is apparently to small size after upgrading to 4.24.2. I changed the environment variable to “-Xms2048m -Xmx2048m”, and voila - it compiled without errors.