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

后端 未结 16 1265
一整个雨季
一整个雨季 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:12

    I fixed it just by editing the gradle-wrapper.properties file.

    You must go to the project folder, then /android/grandle/wrapper/gradle-wrapper.properties. In DistributionUrl, change to https \: //services.gradle.org/distributions/gradle-6.4.1-all.zip.

    0 讨论(0)
  • 2020-12-02 12:13
    1. This is because of the gradle version.

    2. Go to: gradle/wrapper/gradle-wrapper.properties.

    3. Change a version of the course by this:

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

    The console outputs:

    Welcome to Gradle 6.3!
    
    Here are the highlights of this release:
     - Java 14 support
     - Improved error messages for unexpected failures
    
    For more details see https://docs.gradle.org/6.3/release-notes.html
    
    Starting a Gradle Daemon (subsequent builds will be faster)
    
    0 讨论(0)
  • 2020-12-02 12:14

    For me the solution was to upgrade the gradle version to 6.3 from the android project structure (java 14.0.1 is already installed on my pc).

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

    The problem in my case was in the discrepancy between the Gradle version installed globally and the one required by React Native. To fix it, I had to update the folder android/gradle/wrapper from the current 6.5 RN version from GH.

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

    I'm using Pop OS 20.04 and I have Java versions 8, 11 and 14 installed on my notebook.

    This error was happening to me when version 14 was standard.

    When I switched to using version 11 as the default, the error no longer occurred.

    sudo update-alternatives --config java
    
    0 讨论(0)
  • 2020-12-02 12:18

    In gradle-wrapper.properties file, updating the Gradle to 6.3 solved the problem on Mac OS Catalina

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

    0 讨论(0)
提交回复
热议问题