I'm trying to create a SPM from a module which contains a simple object file.
object Strings {
val TitleTalks = "Talks"
val TabTalks = "Talks"
val TabChannels = "Channel"
val TabProfile = "Profile"
}
complete build.gradle looks like this
plugins {
kotlin("multiplatform")
id("com.android.library")
id("com.chromaticnoise.multiplatform-swiftpackage") version "2.0.3"
}
kotlin {
multiplatformSwiftPackage {
swiftToolsVersion("5.3")
targetPlatforms {
iOS { v("13") }
}
packageName("AppStrings")
outputDirectory(File(projectDir, "spm/strings"))
}
android()
ios {
binaries {
framework {
baseName = "strings"
isStatic = false
}
}
}
iosSimulatorArm64 {
binaries {
framework {
baseName = "strings"
isStatic = false
}
}
}
sourceSets {
val commonMain by getting {
dependencies {
implementation(libs.moko.resources.core)
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
}
}
val androidMain by getting {
dependencies {
implementation(libs.moko.resources.compose)
}
}
val androidTest by getting
val iosMain by getting
val iosTest by getting
val iosSimulatorArm64Main by getting {
dependsOn(iosMain)
}
val iosSimulatorArm64Test by getting {
dependsOn(iosTest)
}
}
}
android {..}
But I always get the following build error whenever I try accessing Strings.xx inside my Swift file
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_StringsStrings", referenced from:
objc-class-ref in ContentView.o
ld: symbol(s) not found for architecture arm64
I'm trying to create a SPM from a module which contains a simple object file.
complete build.gradle looks like this
But I always get the following build error whenever I try accessing Strings.xx inside my Swift file