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

Multiplatform template in IDEA / Android Studio. Compose classes are underlined in desktop module #21

Closed
igordmn opened this issue Oct 21, 2020 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@igordmn
Copy link
Collaborator

igordmn commented Oct 21, 2020

If we open multiplatform template in IDEA or Android studio (templates/multiplatform), all compose classes will be underlined:

"Class 'androidx.compose.runtime.MutableState' is compiled by a new Kotlin compiler backend and cannot be loaded by the old compiler"

image

P.S. templates/desktop template is working fine

@igordmn igordmn self-assigned this Oct 21, 2020
@igordmn
Copy link
Collaborator Author

igordmn commented Oct 21, 2020

Also reproduced in templates/desktop if we define kotlin version in settings.gradle.kts:

buildscript {
    repositories {
        jcenter()
    }

    dependencies {
        classpath(kotlin("gradle-plugin", version = "1.4.0"))
    }
}

instead of build.gradle.kts

@igordmn
Copy link
Collaborator Author

igordmn commented Oct 21, 2020

Reproduced in:
multiplatform.zip
desktop_version_in_settings.zip

Not reproduced in:
desktop.zip

@igordmn
Copy link
Collaborator Author

igordmn commented Oct 21, 2020

For multiplatform project we can't define kotlin version in build.gradle.kts (it seems that Android Gradle Plugin doesn't support it)

@igordmn igordmn added the bug Something isn't working label Oct 22, 2020
igordmn added a commit that referenced this issue Oct 26, 2020
Fixes:
- #21
We need to move buildscript from settings.gradle.kts to build.gradle.kts
See also https://youtrack.jetbrains.com/issue/KT-36331

- #22
kotlin("jvm") plugin doesn't work well with MPP modules.
To fix this issues we need to use kotlin("multiplatform") even if we targeting single platform.
See also https://youtrack.jetbrains.com/issue/KT-42823
igordmn added a commit that referenced this issue Oct 26, 2020
Fixes:
- #21
We need to move buildscript from settings.gradle.kts to build.gradle.kts
See also https://youtrack.jetbrains.com/issue/KT-36331

- #22
kotlin("jvm") plugin doesn't work well with MPP modules.
To fix this issue we need to use kotlin("multiplatform") even if we targeting single platform.
See also https://youtrack.jetbrains.com/issue/KT-42823
@igordmn igordmn closed this as completed Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant