I need to see my dependencies in Gradle to fix a problem with multiple SLF4J bindings.
However, when I run 'gradle dependencies' I get the error:
Could not initialize class org.codehaus.groovy.runtime.InvokerHelper
In a similar question in stack-overflow Android Studio Could not initialize class org.codehaus.groovy.runtime.InvokerHelper
it was recommended to
- install java jdk-14
- upgrade to gradle version 6.3
I changed the jdk to 14 in IntelliJ in 2 places:
- File -> Project Structure -> Project -> Project SDK
- Preferences -> Gradle -> Gradle JVM
I attempted to update gradle from the command line with: 'gradle wrapper --gradle-version 6.3' and got the same error:
Could not initialize class org.codehaus.groovy.runtime.InvokerHelper
I then changed the field 'distributionUrl' in the file 'gradle-wrapper.properties' to 'gradle-6.3', as instructed here https://github.com/gradle/gradle/issues/10248.
I tried various combinations of jdk and gradle versions but nothing seems to work.