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

后端 未结 19 800
挽巷
挽巷 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:15

    I first tried with invalidate cache/ restart option but it doesn't help me.

    When I updated Kotlin to 1.1.60 in project's gradle file, problem is solved.

    Also, use this in app's gradle for stdlib

    implementation "org.jetbrains.kotlin:kotlin-stdlib:1.1.60" 
    

    instead of

    implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.60"
    
    0 讨论(0)
  • 2020-12-18 18:16

    In my case, it was a broken update of one of the plugins I've used. Check your error logs from Android Studio this will lead you to what is the problem.

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

    I have faced this issue recently... when I updated to Android Studio 3.1 .

    I did a few things to fix this.

    1. First I updated the Kotlin version in my app gradle file and added

      implementation "org.jetbrains.kotlin:kotlin-stdlib:1.2.31" 
      

      in my app gradle file. But this alone didn't fix it.

    2. Then uninstalled the kotlin plugin from settings, restarted Android Studio and installed it again.

    EDIT :

    This is my project gradle file

    buildscript {
       ext.kotlin_version = '1.2.31'
       repositories {
          jcenter()
          google()
        }
       dependencies {
          classpath 'com.android.tools.build:gradle:3.1.1'
          classpath 'com.google.gms:google-services:3.1.0'
          classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.31"
    
       }
     }
    
    allprojects {
       repositories {
          jcenter()
          maven { url "https://jitpack.io" }
          google()
       }
    }
    

    And this is my app gradle file

    apply plugin: 'com.android.application'
    apply plugin: 'kotlin-android'
    
    android {
    
       compileSdkVersion 27
    
       buildToolsVersion '27.0.3'
    
       defaultConfig {
           ...
        }
    
        buildTypes {
            ...
        }
    
        sourceSets {
             main.java.srcDirs += 'src/main/kotlin'
         }
    
         kapt { generateStubs = true }
    
    
    }
    repositories {
         ...
    }
    
    
    dependencies {
        ...
        ...
        implementation "org.jetbrains.kotlin:kotlin-stdlib:1.2.31"
        ...
        ...
    
     }
    
    apply plugin: 'com.google.gms.google-services'
    
    0 讨论(0)
  • 2020-12-18 18:19

    I have tried all above solutions but non of them works for me.

    Then finally I got success with below solution, so it may helpful for some one like me.

    1. Delele all .iml files (in root project, libraries and modules)
    2. Rebuild project
    0 讨论(0)
  • 2020-12-18 18:20

    In Android Studio, click on File -> Invalidate Caches / Restart... , then select "Invalidated and Restart". This solved my problem.

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

    A common reason of the "Kotlin Not Configured" message is an internal Android Studio exception due to a bad plugin. In order to fix that you should disable the bad plugin.

    When such plugin crash occurs, on the "Wellcome screen" you'll see a small notification (see illustration image) where you can click it and disable the bad plugin:

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