compose-multiplatform: Trying Plugin template results in error in the :common folder: > The 'java' plugin has been applied, but it is not compatible with the Android plugins.
I want to try the feature out to develop both Android and Desktop application.
I just intalled v1.0.0 of the Plugin: Compose Multiplatform IDE Support on my IntelliJ 2021.3 Ultimate (Build #IU-213.5744.223, built on November 27, 2021). Windows is running at version: Windows 10 Pro Version 21H2 OS build 19044.1387
Which template I chose: File > New > Project: chose Kotlin > chose Compose Multiplatform Application uses Kotlin 1.5.21 > Next > Finish
Error I get:
A problem occurred configuring project ‘:common’.
The ‘java’ plugin has been applied, but it is not compatible with the Android plugins.
It generated the following build. It wont’t build because there’s an error in the common build.gradle.kts. (All the other scripts could be build when removed the lines where it would include :common)
import org.jetbrains.compose.compose
plugins {
kotlin("multiplatform")
id("org.jetbrains.compose") version "1.0.0-alpha3"
application
id("com.android.library")
}
group = "com.project"
version = "1.0"
kotlin {
android()
jvm("desktop") {
compilations.all {
kotlinOptions.jvmTarget = "11"
}
}
sourceSets {
val commonMain by getting {
dependencies {
api(compose.runtime)
api(compose.foundation)
api(compose.material)
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
}
}
val androidMain by getting {
dependencies {
api("androidx.appcompat:appcompat:1.2.0")
api("androidx.core:core-ktx:1.3.1")
}
}
val androidTest by getting {
dependencies {
implementation("junit:junit:4.13")
}
}
val desktopMain by getting {
dependencies {
api(compose.preview)
}
}
val desktopTest by getting
}
}
android {
compileSdkVersion(30)
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
defaultConfig {
minSdkVersion(24)
targetSdkVersion(30)
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}
application {
mainClass.set("MainKt")
}
Any solutiuons or workaround is creatly appreciated!
About this issue
- Original URL
- State: open
- Created 3 years ago
- Comments: 16 (7 by maintainers)
Commits related to this issue
- Kotlin project wizard. Fix for https://github.com/JetBrains/compose-jb/issues/1577 GitOrigin-RevId: 9d69001ecfdda461b4369acfa284f1c0e123708a — committed to JetBrains/intellij-community by deleted user 3 years ago
- Kotlin project wizard. Fix for https://github.com/JetBrains/compose-jb/issues/1577 GitOrigin-RevId: 99f813b8c4e16c57d5c55328e2d118e560d88467 — committed to JetBrains/intellij-community by deleted user 3 years ago
- Kotlin project wizard. Fix for https://github.com/JetBrains/compose-jb/issues/1577 (cherry picked from commit 99f813b8c4e16c57d5c55328e2d118e560d88467) GitOrigin-RevId: 607f7382e9e25886feacb59b440f9... — committed to JetBrains/intellij-community by deleted user 3 years ago
- Kotlin project wizard. Fix for https://github.com/JetBrains/compose-jb/issues/1577 (cherry picked from commit 99f813b8c4e16c57d5c55328e2d118e560d88467) GitOrigin-RevId: e632a92d16cf69cee5d142e893db1... — committed to JetBrains/intellij-community by deleted user 3 years ago
facing this issue when using javafx plugin in shared build.gradle
The fix has been developed. It should be available with the new kotlin plugin for idea 21.3 (there is no such issue in older versions)