can you share your buildscript (build.gradle) and what the server (i assume jenkins or some other CI) is executing ? @Hullaballoonatic
also feel free to share your github project ,i would nto mind having a look and trying to help out with builscript issues