JDK14 Flutter Gradle "Could not initialize class"

On my way creating my own solution regarding doorbells, homeautomation, SIP and stuff I stumbled onto a problem because

"Could not initialize class org.codehaus.groovy.runtime.InvokerHelper"

The answer: The Flutter Android project is initializing the Gradle settings with version 5.6.2 and this is the cause of the problem. For JDK 14 we need to set another version here, like

distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-all.zip

in 'android/gradle/wrapper/gradle-wrapper.properties' and then it should work like a charm on the next build :).