I just use standard setup from Kotlin Multiplatform Wizard and manually setup CocoaPods plugin.
here is my configuration:
libs.versions.toml
[versions]agp = "8.5.2"android-compileSdk = "34"android-minSdk = "24"android-targetSdk = "34"androidx-activityCompose = "1.9.3"androidx-appcompat = "1.7.0"androidx-constraintlayout = "2.2.0"androidx-core-ktx = "1.15.0"androidx-espresso-core = "3.6.1"androidx-lifecycle = "2.8.4"androidx-material = "1.12.0"androidx-test-junit = "1.2.1"compose-multiplatform = "1.7.0"junit = "4.13.2"kotlin = "2.1.0"[libraries]kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }kotlin-test-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" }junit = { group = "junit", name = "junit", version.ref = "junit" }androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "androidx-core-ktx" }androidx-test-junit = { group = "androidx.test.ext", name = "junit", version.ref = "androidx-test-junit" }androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "androidx-espresso-core" }androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "androidx-appcompat" }androidx-material = { group = "com.google.android.material", name = "material", version.ref = "androidx-material" }androidx-constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "androidx-constraintlayout" }androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activityCompose" }androidx-lifecycle-viewmodel = { group = "org.jetbrains.androidx.lifecycle", name = "lifecycle-viewmodel", version.ref = "androidx-lifecycle" }androidx-lifecycle-runtime-compose = { group = "org.jetbrains.androidx.lifecycle", name = "lifecycle-runtime-compose", version.ref = "androidx-lifecycle" }[plugins]androidApplication = { id = "com.android.application", version.ref = "agp" }androidLibrary = { id = "com.android.library", version.ref = "agp" }composeMultiplatform = { id = "org.jetbrains.compose", version.ref = "compose-multiplatform" }composeCompiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }kotlinCocoapods = { id = "org.jetbrains.kotlin.native.cocoapods", version.ref = "kotlin" }
build.gradle.kts (root folder)
plugins { // this is necessary to avoid the plugins to be loaded multiple times // in each subproject's classloader alias(libs.plugins.androidApplication) apply false alias(libs.plugins.androidLibrary) apply false alias(libs.plugins.composeMultiplatform) apply false alias(libs.plugins.composeCompiler) apply false alias(libs.plugins.kotlinMultiplatform) apply false alias(libs.plugins.kotlinCocoapods) apply false}
build.gradle.kts (composeApp folder)
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApiimport org.jetbrains.kotlin.gradle.dsl.JvmTargetimport org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildTypeplugins { alias(libs.plugins.kotlinMultiplatform) alias(libs.plugins.androidApplication) alias(libs.plugins.composeMultiplatform) alias(libs.plugins.composeCompiler) alias(libs.plugins.kotlinCocoapods)}kotlin { androidTarget { @OptIn(ExperimentalKotlinGradlePluginApi::class) compilerOptions { jvmTarget.set(JvmTarget.JVM_11) } } cocoapods { summary = "KMP local shared code" homepage = "http://localhost" ios.deploymentTarget = "15.3" version = "1.0.0" name = "ComposeApp" framework { baseName = "ComposeApp" isStatic = true } podfile = project.file("../iosApp/Podfile") xcodeConfigurationToNativeBuildType["CUSTOM_DEBUG"] = NativeBuildType.DEBUG xcodeConfigurationToNativeBuildType["CUSTOM_RELEASE"] = NativeBuildType.RELEASE } iosX64() iosArm64() iosSimulatorArm64() sourceSets { androidMain.dependencies { implementation(compose.preview) implementation(libs.androidx.activity.compose) } commonMain.dependencies { implementation(compose.runtime) implementation(compose.foundation) implementation(compose.material) implementation(compose.ui) implementation(compose.components.resources) implementation(compose.components.uiToolingPreview) implementation(libs.androidx.lifecycle.viewmodel) implementation(libs.androidx.lifecycle.runtime.compose) } }}android { namespace = "com.awesome.app" compileSdk = libs.versions.android.compileSdk.get().toInt() defaultConfig { applicationId = "com.awesome.app" minSdk = libs.versions.android.minSdk.get().toInt() targetSdk = libs.versions.android.targetSdk.get().toInt() versionCode = 1 versionName = "1.0" } packaging { resources { excludes += "/META-INF/{AL2.0,LGPL2.1}" } } buildTypes { getByName("release") { isMinifyEnabled = false } } compileOptions { sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11 }}dependencies { debugImplementation(compose.uiTooling)}
Podfile (iosApp folder)
platform :ios, '15.3'use_frameworks!target 'iosApp' do # Pods for iosApp pod 'ComposeApp', :path => '../composeApp'end
If I open iosApp.xcworkspace
in Xcode it will build and run well but from Fleet IDE if I click run button and select iosApp it will fail to build:
ld: framework 'Pods_iosApp' not foundclang: error: linker command failed with exit code 1 (use -v to see invocation)
Why? Fleet is not working with CocoaPods KMP plugin properly? Or what I missed?How to build and run iOS app with CocoaPods in Fleet IDE?
pod --version1.16.2
Xcode version 15.4