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.
See original GitHub issueI 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!
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (7 by maintainers)
Top GitHub Comments
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)
@igordmn Do you know the status of this bug / based on the last comment it is unclear if it should be closed or if it remains open for reasons?