Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to declare screens on commonMain #48

Closed
xxfast opened this issue Feb 21, 2022 · 2 comments
Closed

Unable to declare screens on commonMain #48

xxfast opened this issue Feb 21, 2022 · 2 comments

Comments

@xxfast
Copy link

xxfast commented Feb 21, 2022

I'm running into a weird issue with this library, that I haven't yet run into with other multiplatform libraries

I have a multiplatform module that targets android and desktop, which is setup like

import org.jetbrains.compose.compose

plugins {
  id("com.android.library")
  kotlin("multiplatform")
  id("org.jetbrains.compose")
}

kotlin {
  android { .. }

  jvm("desktop") { .. }

  sourceSets {
    val commonMain by getting {
      dependencies {
        implementation(compose.runtime)
        ..
        implementation(Adriel.voyagerNavigator)
        implementation(Adriel.voyagerTabNavigator)
      }
    }

    val androidMain by getting { .. }
    val desktopMain by getting { .. }
  }
}

However, when I try to declare any screens in the commonMain, I get
Screen Shot 2022-02-21 at 4 18 16 pm

If I move to the declaration to desktopMain, it works just fine. Any idea why is this happening 🤔

@DevSrSouza
Copy link
Collaborator

I test here and seems to be building even with AS/IntelliJ yelling.

I did a quick fix by changing in the gradle.properties: kotlin.mpp.enableGranularSourceSetsMetadata=false

I'm still trying to understand why this is not working with true, this also happening with my compose-icons library

@adrielcafe
Copy link
Owner

Closing since it's not a library issue.

Feel free to reopen if find a better solution/workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants