Android Studio: How to access project level compileSdkVersion and targetSdkVersion in Kotlin Multiplatform shared module build.gradle.kts?

Viewed 388

I am trying to add a KMM shared module to my existing Android Studio project. I would like to use the compileSdkVersion and targetSdkVersion from project level build.gradle in the shared module, but I can't seem to use it.

Here's the code snippet from shared module build.gradle.kts:

android {
    compileSdkVersion(30) // I want to use a project-wide variable here instead of '30'
    defaultConfig {
        minSdkVersion(23) // And here
        targetSdkVersion(30) // And here
    }
    sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
}

How can I do this?

1 Answers
Related