[Help] Packaging - NoClassDefFoundError org.codehaus.groovy.vmplugin.v7.Java7

I’m trying to build a game and run it on android but I keep getting the following error:

UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7

It’s part of a bigger log and stacktrace, but nothing seems to be relevant.

Any idea what can cause this and how to fix it?