Home > Net >  Gradle Issues in Android Studio
Gradle Issues in Android Studio

Time:07-20

There's a Java file I'm meant to convert to Kotlin. I'm stuck with this Gradle problem and can't find my way around it. What can I do to resolve this issue?

enter image description here

CodePudding user response:

Go to build.gradle(Module)

and inside dependencies add the following line.

classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10'

It should look something like this


buildscript {

    repositories {
        jcenter()
        google()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0-beta6'
        classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        google()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

  • Related