Android Studio Could not initialize class org.codehaus.groovy.runtime.InvokerHelper

后端 未结 16 1267
一整个雨季
一整个雨季 2020-12-02 11:29

I am new in Android Studio. After setup, When I am trying to import an application I am getting that error So that gradle not able to build.

Error:Could not

相关标签:
16条回答
  • 2020-12-02 12:31

    I get this error when I open a new project with VS Code & Flutter. I solved the problem by editing the gradle.build and gradle-wrapper.properties files.

    Edit android>build.gradle like this:

    dependencies { classpath 'com.android.tools.build:gradle:3.5.0' classpath 'com.google.gms: google-services: 4.3.3' //add this line classpath "org.jetbrains.kotlin: kotlin-gradle-plugin: $ kotlin_version" }

    Edit gradle-wrapper.properties

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

    0 讨论(0)
  • 2020-12-02 12:33

    Please make changes as per below to resolve this error.

    Install Java SDK version: 14 or above.

    JDK Download link: https://www.oracle.com/java/technologies/javase-jdk14-downloads.html

    In gradle-wrapper.properties please use grade version 6.3 or above.

    For e.g:distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip

    0 讨论(0)
  • 2020-12-02 12:33

    When you upgrade to the latest version of the gradle in the gradle-wrapper.properties file i.e. distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip please do not forget to change the gradle version in the build.gradle file as well

    wrapper {
        gradleVersion = '6.6.1'
    }
    
    0 讨论(0)
  • 2020-12-02 12:35

    In my case problem was that my version of gradle was incompatible with jdk14, but despite in project structure dialog was selected 8jdk, it was necessarily to set jdk home for gradle separately in gradle.propperties

    org.gradle.java.home=/Library/Java/JavaVirtualMachines/jdk1.8.0_251.jdk/Contents/Home
    
    0 讨论(0)
提交回复
热议问题