Mugo
07/24/2025, 4:34 PMimport org.gradle.accessors.dm.LibrariesForLibs
plugins {
id("com.android.kotlin.multiplatform.library")
id("id-cmp")
}
val libs = the<LibrariesForLibs>()
kotlin {
jvm("desktop")
// iosX64()
// iosArm64()
// iosSimulatorArm64()
androidLibrary {
experimentalProperties["android.experimental.kmp.enableAndroidResources"] = true
compileSdk = libs.versions.android.compileSdk.get().toInt()
minSdk = libs.versions.android.minSdk.get().toInt()
}
}
The Problem: For the 2 libraries WITHOUT iOS targets - when I try to import them in feature modules of separate apps, I can't access anything from commonMain
. However, I CAN access them from androidMain
and desktopMain
source sets.
Plot twist: The same applications can access classes/packages from their own composeApp
modules just fine.
Anyone seen this before or have ideas? Is this a known KMP issue with partial target configurations?CLOVIS
07/25/2025, 9:41 AMid-cmp
?Mugo
07/25/2025, 9:43 AMplugins {
id("id-kmp")
org.jetbrains.compose
kotlin-composecompiler
}
val libs = the<LibrariesForLibs>()
kotlin {
jvm("desktop") {
attributes.attribute(
org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType.attribute,
org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType.jvm,
)
}
sourceSets {
androidMain.dependencies { implementation(compose.preview) }
commonMain.dependencies {
implementation(compose.components.uiToolingPreview)
implementation(compose.foundation)
implementation(compose.material3)
implementation(compose.runtime)
implementation(compose.ui)
implementation(compose.components.resources)
implementation(compose.uiUtil)
implementation(compose.materialIconsExtended)
implementation(libs.compose.backhandler)
// This was removed from the main compose multiplatform plugin
implementation(libs.material.icons.core)
}
}
}
Mugo
07/25/2025, 9:44 AM