英文:
Could not initialize class org.codehaus.groovy.runtime.InvokerHelper
问题
我尝试使用Android Studio构建项目并运行应用程序,它在Android Studio中正常工作,但当我尝试使用终端命令进行相同操作时,出现以下错误。
构建失败:遇到异常。
- 出现了什么问题:
无法初始化类org.codehaus.groovy.runtime.InvokerHelper
我看到了一些其他答案,但都建议升级JDK,我已经升级了,但没有成功。
我正在使用JDK:Java 14 2020-03-17
Gradle版本:5.6.4
英文:
I tried to build my project and run the app using Android studio and it works fine but when I tried the same using terminal command, it gave me below error.
FAILURE: Build failed with an exception.
- What went wrong:
Could not initialize class org.codehaus.groovy.runtime.InvokerHelper
I saw some other answers but all suggest to upgrade the JDK which I already did but no luck
I am using jdk : java 14 2020-03-17
Gradle version : 5.6.4
答案1
得分: 0
根据这个回答:
在
gradle/wrapper/gradle-wrapper.properties
中升级你的 Gradle 版本将解决你的问题。
英文:
According to this answer;
upgrading your Gradle version in the
gradle/wrapper/gradle-wrapper.properties
will solve your problem.
专注分享java语言的经验与见解,让所有开发者获益!
评论