Please share your build.gradle file if you need more help. I expect this is coming from pre-compile build phase in your xcode project that builds the KMP part of your app via Gradle (which is standard setup in KMP projects).
Google does not publish the compose multiplatform artifacts for non-android platforms. To use Compose Multiplatform, your build.gradle should look something like this: https://github.com/Kotlin/KMP-App-Template/blob/main/composeApp/build.gradle.kts.
In particular, you need to apply these plugins:
plugins {
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.androidApplication)
alias(libs.plugins.composeMultiplatform)
alias(libs.plugins.composeCompiler)
}
And instead of depending on the androidx artifacts directly, declare your dependencies like so:
commonMain.dependencies {
implementation(compose.runtime)
implementation(compose.foundation)
...
}
For posterity, the .toml file declares the exact plugin coordinates:
androidApplication = { id = "com.android.application", version.ref = "agp" }
composeCompiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
composeMultiplatform = { id = "org.jetbrains.compose", version.ref = "compose-multiplatform" }
kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
androidx.compose.foundation:foundation:1.7.0is an Android-specific artifact, that doesn't support iOS target. Perhaps, you're looking for compose multiplatform artifact instead? It has a different package name, check out mvnrepository.com/artifact/org.jetbrains.compose.foundation/… How did you create your project? I recommend to try this wizard kmp.jetbrains.com. If that doesn't work for you, please, share yourbuild.gradlefile