I was asked to install JDK
and Gradle
, and installed them successfully, gradle -v
works (version 6.1.1), but if I try to build something, or even type gradle -tasks
in the command line, it fails:
FAILURE: Build failed with an exception. *What went wrong: Could not initialize class org.codehaus.groovy.runtime.InvokerHelper
I've searched the problem and people who experience it are using React Native or VS or Android Emulator, so solutions are written in those, but I'm only trying to use the command line.
What commands can solve the problem?
(NOTE: I'm quite new to developing)
It is related to your JDK version.
Check https://github.com/gradle/gradle/issues/12599
It happens to me a while ago and I downgraded the jdk version.
I suggest to upgrade Gradle at least to 6.3 or download your jdk.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.