question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot configure KMP project with JS target

See original GitHub issue

Build Environment SQLDelight version: 1.5.0 OS: Windows Gradle version: 7.0.1 Kotlin version: 1.5.0 AGP Version (if applicable): N/A

Example: project-2.zip

Describe the bug

  1. This project contains a few modules for a KMP project. For simplicity’s sake there is no source code, only the gradle files.
  2. The app/build.gradle file line 18 adds com.squareup.sqldelight:gradle-plugin:1.5.0 to the classpath.
  3. When I try to launch any tasks from gradle I get the error:
Caused by: java.lang.IllegalStateException: The Kotlin Gradle plugin was loaded multiple times in different subprojects, which is not supported and may break the build. 
This might happen in subprojects that apply the Kotlin plugins with the Gradle 'plugins { ... }' DSL if they specify explicit versions, even if the versions are equal.
Please add the Kotlin plugin to the common parent project or the root project, then remove the versions in the subprojects.
If the parent project does not need the plugin, add 'apply false' to the plugin line.
  1. If I were to remove the classpath, the project configures and compiles correctly. Otherwise if I remove the JS target in gradle/mpp-lib.gradle, the project is also able to configure and compile.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
JakeWhartoncommented, Jun 7, 2021

Yeah they don’t have to be, but it’s safest to do it that way because of problems like this.

Going to close. Thanks for looking @dellisd!

0reactions
CRamsancommented, Jun 7, 2021

That makes sense. Thanks for the insight.

Read more comments on GitHub >

github_iconTop Results From Across the Web

javascript as target in kotlin multiplatform library - Stack Overflow
I'm building a Kotlin multiplatform library. One of the targets in this project is javascript. In the source ...
Read more >
If I add a js target to my KMP build I get the following err | Gradle
If I add a js target to my KMP build I get the following error Build was configured to prefer settings repositories over...
Read more >
How can i use jsMain in KMP?When can we update ... - GitHub
I removed the js(IR) config,and build a project named web,dependent on the common project. When i run the jsBrowserRun or jsBrowserWebpack got ...
Read more >
Adding a new target to your KMP project: hello watchOS
I've recently added support for watchOS on a project that already shares its business logic through Android, iOS, and Desktop. As always, this...
Read more >
Introducing Kotlin Multiplatform in an existing project
When starting a new blank KMP project it is easier to have a ... because the configuration and the target architecture are computed...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found