Alfie
08/09/2023, 6:59 AMld: warning: directory not found for option '-F/Users/xxx/My Apps/my_project/shared/build/xcode-frameworks/Debug/macosx13.3'
ld: framework not found shared
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Which makes sense as the folder xcode-frameworks doesnt exist. Is this supposed to be generated for me when i make & build the shared module in android? Because i’ve done this alreadyMaxime Vince
08/09/2023, 7:08 AMAlfie
08/09/2023, 7:09 AMMaxime Vince
08/09/2023, 7:11 AMAlfie
08/09/2023, 7:13 AMMaxime Vince
08/09/2023, 7:14 AMAlfie
08/09/2023, 7:14 AMplugins {
kotlin("multiplatform")
id("com.android.library")
}
@OptIn(org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi::class)
kotlin {
targetHierarchy.default()
android {
compilations.all {
kotlinOptions {
jvmTarget = "1.8"
}
}
}
listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64()
).forEach {
it.binaries.framework {
baseName = "shared"
}
}
sourceSets {
val commonMain by getting {
dependencies {
//put your multiplatform dependencies here
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
}
}
}
}
android {
namespace = "com.xxx.xxx.shared"
compileSdk = 33
defaultConfig {
minSdk = 21
}
}
Alfie
08/09/2023, 7:15 AMMaxime Vince
08/09/2023, 7:16 AMAlfie
08/09/2023, 7:21 AMOn the Build Settings tab, switch to All build settings and specify the Framework Search Path under Search Paths:
but as mentionedCopy code$(SRCROOT)/../shared/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)
xcode-frameworks
folder doesnt existMaxime Vince
08/09/2023, 7:29 AMval xcf = XCFramework()
listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64()
).forEach {
it.binaries.framework {
baseName = "MyCardKmm"
xcf.add(this)
}
}
and after that execute:
./gradlew assembleDebugXCFramework
And you will have your folder 🙂Alfie
08/09/2023, 7:37 AM* What went wrong:
Task 'assembleDebugXCFramework' is ambiguous in root project 'xxx' and its subprojects. Candidates are: 'assembleDebugIosFatFrameworkForSharedXCFramework', 'assembleDebugIosSimulatorFatFrameworkForSharedXCFramework', 'assembleDebugMacosFatFrameworkForSharedXCFramework', 'assembleDebugTvosFatFrameworkForSharedXCFramework', 'assembleDebugTvosSimulatorFatFrameworkForSharedXCFramework', 'assembleDebugWatchosFatFrameworkForSharedXCFramework', 'assembleDebugWatchosSimulatorFatFrameworkForSharedXCFramework', 'assembleSharedDebugXCFramework'.
Alfie
08/09/2023, 7:44 AMassembleSharedDebugXCFramework
which gave me XCFrameworks folder in shared/build which is great, but it does differ to the naming thats given in the official guide which would be shared/build/xcode-frameworks
?
But unfortunately still when trying to build the xcode project it says
ld: warning: directory not found for option '-F/Users/xxx/My Apps/xxx/shared/build/XCFrameworks/Debug/macosx13.3'
Again the template for this in xcode is
$(SRCROOT)/../shared/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)
What would be my sdk name?Alfie
08/09/2023, 7:55 AMMaxime Vince
08/09/2023, 8:51 AMColton Idle
08/09/2023, 11:57 AM