yshrsmz / BuildKonfig

BuildConfig for Kotlin Multiplatform Project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Kotlin/JS Exception: non-flavored defaultConfigs must be provided. Despite is provided.

mariuszmarzec opened this issue · comments

Hey,
Thanks for your effort and great tool. I tried to add to my compose playgrond project JS MPP target, using latest version 0.11.0 of BuildKonfig got this error during project sync:
org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':common' Caused by: java.lang.IllegalStateException: non-flavored defaultConfigs must be provided. at com.codingfeline.buildkonfig.gradle.BuildKonfigSpecKt.mergeConfigs(BuildKonfigSpec.kt:29)

Reproducible on this branch in my project:
https://github.com/mariuszmarzec/todo/tree/feature/js_support

Thanks a lot, will take a look

I cloned your repository, checked out feature/js_support, ran ./gradlew :common:generateBuildKonfig and it seems to work fine for me 🤔

@yshrsmz I didn't think before about runing generateBuildKonfig task only. It failed for me due to adding "clean" task in one of file. Strange, but removing it helps and syncing works now.

Hey, Flavio here

I had the same problem today but what I found is that when you add an extra line or statement in the Gradle file that is not contained inside a function, then the sync fails with the message “non-flavored defaultConfigs must be provided”.

So, if you have any statement in a lonely single line, then you are going to get this error.

@jflavio11 Can you provide a reproduction project(or a gradle file)?