Maximilian Pröll
11/13/2023, 2:47 PM> Task :shared:linkDebugFrameworkIosSimulatorArm64 FAILED
error: Could not find "Compose" in [/Users/max/StudioProjects/compose-multiplatform-pomodoro, /Users/max/.konan/klib, /Users/max/.konan/kotlin-native-prebuilt-macos-aarch64-1.9.10/klib/common, /Users/max/.konan/kotlin-native-prebuilt-macos-aarch64-1.9.10/klib/platform/ios_simulator_arm64]
And this is the build.gradle file of the library:
plugins {
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.android.library)
alias(libs.plugins.compose.multiplatform)
id("maven-publish")
id("signing")
id("com.vanniktech.maven.publish") version "0.25.3"
}
kotlin {
androidTarget {
compilations.all {
kotlinOptions {
jvmTarget = "17"
}
}
publishLibraryVariants("release", "debug")
}
ios{}
iosX64()
iosArm64()
iosSimulatorArm64()
sourceSets {
val commonMain by getting {
dependencies {
api(compose.runtime)
api(compose.foundation)
api(compose.material3)
api(compose.animation)
implementation(libs.kotlinx.atomicfu)
}
}
val commonTest by getting {
dependencies {
//implementation(libs.kotlin.test)
}
}
val iosX64Main by getting
val iosArm64Main by getting
val iosSimulatorArm64Main by getting
val iosMain by getting {
dependsOn(commonMain)
iosX64Main.dependsOn(this)
iosArm64Main.dependsOn(this)
iosSimulatorArm64Main.dependsOn(this)
}
}
}
android {
namespace = "..."
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlin {
jvmToolchain(17)
}
compileSdk = 34
defaultConfig {
minSdk = 26
}
}
mavenPublishing {
...
}
In the app, which uses the library, I simply have added it as a commonMain dependency:
api(libs.compose.multiplatform.chart)
What could be the problem here? Why doesn't the task find "Compose"?Dima Avdeev
11/14/2023, 11:32 AMNikita Lipsky
11/14/2023, 11:36 AMMaximilian Pröll
11/14/2023, 11:45 AMcommonMain
block.Nikita Lipsky
11/15/2023, 7:02 PMI haven't pushed the added dependency though, as the app doesn't build for iOSSo what line should I add to reproduce the problem?
Maximilian Pröll
11/15/2023, 9:00 PMimplementation("io.github.maximilianproell:compose-multiplatform-chart:2.0.2-SNAPSHOT")
to commonMain
of any KMP project targeting Android and iOS, observe that the Android App builds and runs successfully, whereas the iOS version does not build, throwing the error message mentioned above.