你好吗?
您在使用 kotlin DSL 编写 gradle 插件时是否遇到过这种错误:
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
完整代码如下:
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)
}
预先感谢您的帮助。