Android Studio:Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7

原项目使用jdk8,升级gradle后出现的该问题。

java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7
     at org.codehaus.groovy.vmplugin.VMPluginFactory.(VMPluginFactory.java:43)
     at org.codehaus.groovy.reflection.GroovyClassValueFactory.(GroovyClassValueFactory.java:35)
     at org.codehaus.groovy.reflection.ClassInfo.(ClassInfo.java:109)
     at org.codehaus.groovy.reflection.ReflectionCache.getCachedClass(ReflectionCache.java:95)
     at org.codehaus.groovy.reflection.ReflectionCache.(ReflectionCache.java:39)
     ...

解决方案

升级到jdk11即可

你可能感兴趣的:(android,studio,android,ide)