ivan.savytskyi
02/26/2019, 5:17 PMframework
provided by some vendor) in Kotlin Native?ivan.savytskyi
02/26/2019, 8:04 PMcinterop
will produce bunch some folder and klib file. How to include them into MP project with gradle as a build tool?olonho
02/26/2019, 8:35 PMivan.savytskyi
02/26/2019, 8:58 PMivan.savytskyi
02/26/2019, 9:01 PMframework
lives, getting error: linkMainDebugFrameworkIos
ld: framework not found ...
svyatoslav.scherbina
02/27/2019, 7:27 AM-F
linker option in your Gradle build script or .def
file?ivan.savytskyi
02/27/2019, 5:20 PMivan.savytskyi
02/27/2019, 5:20 PMfromPreset(presets.iosX64, 'ios') {
compilations.main {
kotlinOptions.freeCompilerArgs = ["-Xverbose-phases=linker"]
outputKinds('FRAMEWORK')
cinterops {
SharedLib {
// Def-file describing the native API.
// The default path is src/nativeInterop/cinterop/<interop-name>.def
defFile project.file("/Users/ivansavytskyi/Projects/{some path}/SharedLib.def")
// Package to place the Kotlin API generated.
packageName 'com.shopify.greeter'
// Options to be passed to compiler by cinterop tool.
compilerOpts '-I/Users/ivansavytskyi/Projects/{some path}/SharedLib.framework/Headers/'
linkerOpts '-F/Users/ivansavytskyi/Projects/{some path}/SharedLib.framework/SharedLib'
}
}
}
}
ivan.savytskyi
02/27/2019, 5:20 PMivan.savytskyi
02/27/2019, 5:20 PMlanguage = Objective-C
headers = SharedLib.h SharedLib-Swift.h
headerFilter = SharedLib.h SharedLib-Swift.h
compilerOpts = -framework SharedLib
linkerOpts = -framework SharedLib
ivan.savytskyi
02/27/2019, 5:44 PMivan.savytskyi
02/27/2019, 5:44 PMUndefined symbols for architecture x86_64:
"_OBJC_CLASS_$__TtC9SharedLib7Greeter", referenced from:
objc-class-ref in combined.o
ld: symbol(s) not found for architecture x86_64
svyatoslav.scherbina
02/27/2019, 5:51 PMlinkerOpts
with -F
must be placed under compilations.main {
instead of SharedLib {
.ivan.savytskyi
02/27/2019, 5:56 PMdef
file if I have linkerOpts and compilerOpts in gradle:
compilerOpts = -framework SharedLib
linkerOpts = -framework SharedLib
ivan.savytskyi
02/27/2019, 5:57 PMivan.savytskyi
02/27/2019, 6:12 PMSharedLib.framework
but it needs to be parent path without it, like this -F/Users/ivansavytskyi/Projects/{some path}/
svyatoslav.scherbina
02/28/2019, 6:16 AMdo I still need these lines inYes.file if I have linkerOpts and compilerOpts in gradle:def
ok I think I found the issue, my path for linker was including theLinker opts should still be specified for the binary. Does it work now?but it needs to be parent path without it, like thisSharedLib.framework
-F/Users/ivansavytskyi/Projects/{some path}/