jack_smith
jack_smith

Reputation: 11

How do you fix the following error : Could not find method classpath() for arguments

I am getting the following error when trying to run my Kotlin app with Android Studio and I am unsure why, any ideas?

A problem occurred evaluating root project 'Weather App'.

Could not find method classpath() for arguments [com.android.tools.build:gradle:5.1.2] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

buildscript {
    ext.kotlin_version = '2.4.30'
    ext.room_version = '3.3.0-beta02'
    ext.navigation_version = '2.0.0'
    ext.kodein_version = '6.2.0'
    ext.lifecycle_version = '3.3.0'
    ext.retrofit_version = '3.9.0'
    repositories {
        google()
        jcenter()
        maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }

            }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:5.1.2' // ERROR LINE 17
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'android.arch.navigation:mavigation-safe-args-gradle-plugin:2.0.0-aplha06'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }

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

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

Upvotes: 1

Views: 2043

Answers (1)

Hadi Abedi
Hadi Abedi

Reputation: 166

change classpath:

classpath "com.android.tools.build:gradle:4.1.1"

Upvotes: 1

Related Questions