Updated to Android Studio 3.0. Getting a “Kotlin not configured” error

后端 未结 19 803
挽巷
挽巷 2020-12-18 17:59

I just updated to Android Studio 3.0 and I\'m getting this error with an existing project:

Kotlin not configured

When I go to

相关标签:
19条回答
  • 2020-12-18 18:21

    Though I see that the question already has answers that work, one might also try the following solution.

    Right click on the file name (Main.kt) -> Run 'Main.kt'.

    This will download a gradle file from the gradle.org website.

    Wait for it to unzip. The errors were cleared.

    0 讨论(0)
  • 2020-12-18 18:21

    just delete .idea folder from project,and run android studio again, it will resolve KOTLIN NOT CONFIGURED issue.

    0 讨论(0)
  • 2020-12-18 18:24

    One other point to check is version of your Gradle in gradle-wrapper.properties, if you use one.

    Make sure that distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip

    Has version 4.1 or higher.

    You may also have the following in your build.gradle:

    task wrapper(type: Wrapper) {
        gradleVersion = '4.1'
        distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip"
    }
    

    Where Gradle version is lower that 4.1

    0 讨论(0)
  • 2020-12-18 18:25

    None of the other solutions solved my problem. I ended up figuring out that the problem lied in the google services version. Just update it to the latest.

    Top level gradle at dependencies:

    classpath 'com.google.gms:google-services:4.1.0'
    
    0 讨论(0)
  • 2020-12-18 18:30

    In my case, after the update of Android Studio and plugins, I could create new projects, but my old projects were having "Gradle Sync Issues".

    The solution was in File/Project Structure.../App/Dependencies:

    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 
    

    And then I just updated the Kotlin version in my project build.gradle:

    From:

    ext.kotlin_version = '1.2.30'

    To:

    ext.kotlin_version = '1.3.21'

    Then I tried Sync again.

    Obs: You can check your Kotlin version in Tools/Kotlin/Configure Kotlin Plugin Updates

    0 讨论(0)
  • 2020-12-18 18:31

    Kotlin-stdlib-jre7 is deprecated since 1.2.0 and should be replaced with kotlin-stdlib-jdk7

    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 
    
    0 讨论(0)
提交回复
热议问题