I am trying to add kmm shared module to my ios/android app however, I got this message from Xcode run
Showing Recent Messages A problem occurred configuring project ':shared'.
> Could not identify build type for Kotlin framework 'shared' built via cocoapods plugin with CONFIGURATION=Staging.
Add xcodeConfigurationToNativeBuildType["Staging"]=NativeBuildType.DEBUG or xcodeConfigurationToNativeBuildType["Staging"]=NativeBuildType.RELEASE to cocoapods plugin configuration
Then I added this line to my shared Gradle config Showing Recent Messages A problem occurred configuring project ':shared'.
xcodeConfigurationToNativeBuildType["Staging"]=
org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType.DEBUG
What went wrong: Task 'Debug' not found in project ':shared'.
anyway I have this warnings waringsws⚠️
Unable to detect Kotlin framework build type for CONFIGURATION=Staging Debug automatically. Specify 'KOTLIN_FRAMEWORK_BUILD_TYPE' to 'debug' or 'release
here is the gradle.kts
plugins {
kotlin("multiplatform")
kotlin("native.cocoapods")
id("com.android.library")
}
version = "1.0"
kotlin {
android()
iosX64()
iosArm64()
iosSimulatorArm64()
cocoapods {
summary = "Some description for the Shared Module"
homepage = "Link to the Shared Module homepage"
ios.deploymentTarget = "12.1"
podfile = project.file("../../bas-ios/Podfile")
framework {
baseName = "shared"
}
xcodeConfigurationToNativeBuildType["Staging"] = org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType.DEBUG
}
sourceSets {
val commonMain by getting
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
}
}
val androidMain by getting
val androidTest by getting
val iosX64Main by getting
val iosArm64Main by getting
val iosSimulatorArm64Main by getting
val iosMain by creating {
dependsOn(commonMain)
iosX64Main.dependsOn(this)
iosArm64Main.dependsOn(this)
iosSimulatorArm64Main.dependsOn(this)
}
val iosX64Test by getting
val iosArm64Test by getting
val iosSimulatorArm64Test by getting
val iosTest by creating {
dependsOn(commonTest)
iosX64Test.dependsOn(this)
iosArm64Test.dependsOn(this)
iosSimulatorArm64Test.dependsOn(this)
}
}
}
android {
compileSdk = 32
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
defaultConfig {
minSdk = 24
targetSdk = 32
}
}