Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot access 'com.android.build.gradle.internal.dsl.Lockable' on Android Studio Arctic Fox | 2020.3.1 Canary 12

how are you doing?

Did you get this kind of error when writing a gradle plugin using kotlin DSL:

Cannot access 'com.android.build.gradle.internal.dsl.Lockable' which is a supertype of 'com.android.build.gradle.BaseExtension'. Check your module classpath for missing or conflicting dependencies

Here is the complete code:

import org.gradle.api.Project
import com.android.build.gradle.BaseExtension
import org.gradle.kotlin.dsl.getByType

private typealias AndroidBaseExtension = BaseExtension

fun Project.configureAndroid() = this.extensions.getByType<AndroidBaseExtension>().run{
    compileSdkVersion(30)
}

Thanks in advance for your HELP.

like image 922
Armel Gildas Fagbedji Avatar asked Apr 01 '21 16:04

Armel Gildas Fagbedji


People also ask

What is Android gradle DSL?

The Android Gradle Plugin (AGP) is the supported build system for Android applications and includes support for compiling many different types of sources and linking them together into an application that you can run on a physical Android device or an emulator.


1 Answers

You need a dependency on the new version

implementation("com.android.tools.build:gradle:7.1.0-alpha12")

in your build.gradle.kts (buildSrc module)

like image 130
Frost Avatar answered Oct 21 '22 17:10

Frost