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

Fix Gradle plugin for Multiplatform project #255

Closed
ileasile opened this issue May 21, 2021 · 1 comment · Fixed by #298
Closed

Fix Gradle plugin for Multiplatform project #255

ileasile opened this issue May 21, 2021 · 1 comment · Fixed by #298
Assignees
Labels
bug Installation and functionality issues

Comments

@ileasile
Copy link
Contributor

When applying Gradle plugin in MPP, following message appears:

Single JVM target not found in a multiplatform project

It's because multiplatform targets are not available right after applying Kotlin multiplatform plugin.
This may be fixed by running addDependenciesIfNeeded() after all configurations are done and targets are available.

@ileasile ileasile added the bug Installation and functionality issues label May 21, 2021
@altavir
Copy link
Contributor

altavir commented May 28, 2021

A workaround is to load inactive plugin:

plugins {
    kotlin("multiplatform")
    kotlin("jupyter.api") apply(false)
}

and activate it after kotlin block:

//Applying it after kotlin extension to ensure that JVM target is loaded
//because of https://github.com/Kotlin/kotlin-jupyter/issues/255
plugins.apply(org.jetbrains.kotlinx.jupyter.api.plugin.ApiGradlePlugin::class)

@ileasile ileasile self-assigned this Jul 4, 2021
ileasile added a commit that referenced this issue Jul 7, 2021
ileasile added a commit that referenced this issue Jul 7, 2021
ileasile added a commit that referenced this issue Jul 7, 2021
ileasile added a commit that referenced this issue Jul 7, 2021
ileasile added a commit that referenced this issue Jul 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Installation and functionality issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants