zsperske
08/25/2020, 6:21 PMUndefined symbols for architecture arm64:
"_OBJC_CLASS_$_SharedCodeEventUiModel", referenced from: objc-class-ref in EventUI.o
I assume I need to change my gradle setup but I'm unsure what exactly I need to change.iosPreset
value to iosArm64
but I'm now running into a crash when the app actually starts:
dyld: Library not loaded: @rpath/SharedCode.framework/SharedCode
yousefa2
08/25/2020, 7:02 PMzsperske
08/25/2020, 7:09 PMPods_MyApp.framework
yousefa2
08/25/2020, 7:14 PMPods_MyApp.framework
implies you are using Cocoapods.zsperske
08/25/2020, 7:18 PMkotlin {
targets {
fromPreset(presets.android, 'android')
final def iOSTarget = System.getenv('SDK_NAME')?.startsWith("iphoneos") \
? presets.iosArm64 : presets.iosX64
fromPreset(iOSTarget, 'ios') {
binaries {
framework()
}
}
}
...
task packForXCode {
def buildType = project.findProperty("kotlin.build.type") ?: "DEBUG"
dependsOn "link${buildType.toLowerCase().capitalize()}FrameworkIos"
doLast {
def srcFile = kotlin.targets.ios.binaries.getFramework(buildType).outputFile
def targetDir = getProperty("configuration.build.dir")
copy {
from srcFile.parent
into targetDir
include 'SharedCode.framework/**'
include 'SharedCode .framework.dSYM'
}
}
}
yousefa2
08/25/2020, 7:21 PMSharedCode
.. have a look at this https://play.kotlinlang.org/hands-on/Targeting%20iOS%20and%20Android%20with%20Kotlin%20Multiplatform/06_SettingUpKotlinFramework . It contains all the steps needed.zsperske
08/25/2020, 7:22 PMimport SharedCode
in one of my swift files