Android Studio - Cannot access script base class 'org.gradle.kotlin.dsl.KotlinBuildScript'

65 Views Asked by At

I've been trying to update my android studio project build.gradle(app) from Groovy to Kotlin. I have created a build.gradle.kts file and added a few lines to it:

buildscript {
    repositories {
        mavenCentral()
        google()
        }

    dependencies {
        Dependencies.playServicesGMS
        Dependencies.firebaseCrashlyticsGradle
        Dependencies.hiltGradlePlugin
        }
}

apply (plugin = "com.android.application")
apply (plugin = "com.google.android.gms.oss-licenses-plugin")
apply (plugin = "com.android.application")
apply (plugin = "com.google.gms.google-services")
apply (plugin = "com.google.firebase.crashlytics")
apply (plugin = "kotlin-android")
apply (plugin = "kotlin-parcelize")
apply (plugin = "kotlin-kapt")
apply (plugin = "dagger.hilt.android.plugin")

However I'm getting errors, the code looks like this: enter image description here

This isn't the first gradle.kts file I've created, I have already converted the project build.gradle to build.gradle.kts and coverted the code without encountering this issue.

I have followed this thread, I don't know if it's applicable as I already have a kotlin gradle file successfully converted.

If anyone could help me I would greatly appreciate it as I've spent a lot time on this and I'm not sure what to do next, plus, it shouldn't be this bloody difficult!!

Thank you

0

There are 0 best solutions below