yshrsmz / BuildKonfig

BuildConfig for Kotlin Multiplatform Project
Apache License 2.0
729 stars 33 forks source link

Support Gradle Config Cache #156

Closed ahna92 closed 7 hours ago

ahna92 commented 2 months ago

Describe the bug When enabling Gradle config cache in gradle.properties

org.gradle.configuration-cache=true

I'm getting the following error

e: file:///<build-dir>/BuildKonfig.kt:5:24 'actual object BuildKonfig : Any' has no corresponding expected declaration
e: file:///<build-dir>/BuildKonfig.kt:6:21 'actual val SDK_VERSION: String' has no corresponding expected declaration

The generated class

internal actual object BuildKonfig {
  public actual val SDK_VERSION: String = "0.0.0"
}

When disable the config cache the generated class works and looks like

internal object BuildKonfig {
  public val SDK_VERSION: String = "0.0.0"
}

So there is added actual modifier that is not needed

Desktop (please complete the following information):

RyuNen344 commented 2 months ago

Thank you report

BuildKonfig has already supported gradle configuration cache 👀 This appears to be due to Kotlin 2.0 rather than a configuration cache issue.

Could you try downgrade kotlin version??

ahna92 commented 2 months ago

hi @RyuNen344
I've tested on 1.9.22 , same issue

it worked fine with 2.0 btw , just when enabling org.gradle.configuration-cache while have only defaultConfig it failes

RyuNen344 commented 2 months ago

hmm, I'll check it 🤔

ahna92 commented 7 hours ago

seams issue was with only one project out of 9 closing issue :D