Using BuildKonfig in Compose Multiplatform #157
-
Sorry if it's a duplicated question Background Info
Use via Plugin SetupUnfortunately, after following the Kotlin DSL setup instruction to add buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.0")
classpath("com.codingfeline.buildkonfig:buildkonfig-gradle-plugin:latest_version")
}
}
plugins {
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.androidApplication)
alias(libs.plugins.jetbrainsCompose)
alias(libs.plugins.compose.compiler)
} The gradle does give me this error:
Use via implementationOnce if I place kotlin {
...
sourceSet{
...
commonMain.dependencies {
implementation("com.codingfeline.buildkonfig:buildkonfig-gradle-plugin:0.15.1")
...
}
}
} The gradle raised this error: (Seems all nativeMain are having same issue)
Sorry again for the messy question, also thanks for giving help first! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
@Vocaloid2048 build.gradlle,kts, settings.gradle.kts, project/build.gradle.kts... |
Beta Was this translation helpful? Give feedback.
-
@RyuNen344 Here's the gradle files u requested build.gradle.kts (Root Project)
settings.gradle.kts
build.gradle.kts (composeApp:)
|
Beta Was this translation helpful? Give feedback.
-
Thank you 😉 could you try update project build.gradle.kts like below? import org.jetbrains.compose.desktop.application.dsl.TargetFormat
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import java.util.Properties
// remove build script block
plugins {
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.androidApplication)
alias(libs.plugins.jetbrainsCompose)
alias(libs.plugins.compose.compiler)
// plz replace `$latest_version` with the version you want to use
id("com.codingfeline.buildkonfig").version("$latest_version")
}
// ommit kotlin, android block |
Beta Was this translation helpful? Give feedback.
@Vocaloid2048
Thank you 😉
could you try update project build.gradle.kts like below?