I updated to Android Studio 3.1 and as suggested by Android Studio also:
in your gradle-wrapper.properties, try using:
distributionUrl=https://services.gradle.org/distributions/gradle-4.3-rc-2-all.zip
As this bug commenter pointed out: https://issuetracker.google.com/issues/77605097#comment7
disabling the "configure on demand" feature of Gradle (in Settings: Build, Execution, and Deployment: Compiler) is a viable workaround.
Since I did this my Unit tests are all working again.
Solution from kekkou of the libgdx forums: http://www.badlogicgames.com/forum/viewtopic.php?f=11&t=27639&p=109249#p109249
His solution is: Move the project(':android') {}
block in root build.gradle into android\build.gradle.
This makes all commands work again. I did not find any downsides.
The commit for this fix on my project: https://github.com/Leejjon/BluffPoker/commit/d10deb090c2d80e641d733efdaa85f99c0a9fe2f