Configure Kotlin for Android Studio Electric Eel 2022.1.1

586 Views Asked by At

When I updated to Electric Eel 2022.1.1, every time I create a new Kotlin file, it gives me the notification warning Configure Kotlin Configure 'Name.app' module in 'Name' project asKotlin (Android with Gradle) module.

I have only been working with Kotlin, not Java. I only started getting this warning after the update.

After I click the link to configure as Kotlin (Android with Gradle) module and select All modules containing Kotlin files: Name.app and set the Kotlin compiler to 1.8.0, it still gives me another warning when I make a new file.

Do I need to worry about this warning or can I just ignore it?

Here is my build.gradle (:app)

 plugins {
    id 'com.android.application'
    id 'org.jetbrains.kotlin.android'
}
android {
    namespace 'com.example.name'
    compileSdk 33
    defaultConfig {
        applicationId "com.example.name"
        minSdk 23
        targetSdk 33
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }

    buildFeatures {
        viewBinding true
    }
}
dependencies {

    implementation 'androidx.core:core-ktx:1.9.0'
    implementation 'androidx.appcompat:appcompat:1.7.0-alpha01'
    implementation 'com.google.android.material:material:1.8.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    implementation 'androidx.core:core-ktx:1.9.0'
    implementation 'androidx.core:core-ktx:1.9.0'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.5'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}

and here is the top-level build.gradle:

plugins {
    id 'com.android.application' version '7.4.1' apply false
    id 'com.android.library' version '7.4.1' apply false
    id 'org.jetbrains.kotlin.android' version '1.8.0' apply false
}
1

There are 1 best solutions below

2
On

This isn't something you should worry about. I would recommend sticking to Kotlin 1.8.0 for the time being as an upgrade may cause some compatibility issues with some other dependencies. Mainly material. Also, core-ktx is specified 3 times in your dependencies so I think that's something you need to look into