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.
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.
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With