Hi there, I’m experiencing a similar issue while t...
# kotlin-native
n
Hi there, I’m experiencing a similar issue while trying to link a test binary for iOS simulator: https://kotlinlang.slack.com/archives/C3SGXARS6/p1559551834011200 I followed the suggestion in thread and did this:
Copy code
iosX64('iosX64').binaries.getByName('debugTest').linkerOpts('-framework Foundation')
but
ld
doesn’t seem to like this option: The difference is that the class is from Foundation (
NSURLSessionTaskTransactionMetrics
) and is only available in iOS 10+. At the moment this class is only used in actual code but not in tests. Btw, is there a way to see full
ld
invocations?
@svyatoslav.scherbina I’d appreciate your input if possible.
also looking at default conents of
konan.properties
,
-framework Foundation
is already here in
linkerKonanFlags.ios_x64
.
setting
osVersionMin.ios_x64 = 10.0
doesn’t help either
although setting it to
13.0
helps, why tho
hmmm I see, some properties were added to this class in iOS 13
At the same time, an iOS framework I build of the same Gradle module links just fine.
seems like there must be a magic linker option to make tests link, too
s
This should help:
Copy code
binary.linkerOpts("-ios_simulator_version_min", "13.0.0")
n
@svyatoslav.scherbina thank you! Do I get this right that if a part of an Obj-C class is only available at a higher iOS [or whatever OS it is] version than the rest of the class, it’s currently only possible to use it with this higher version onwards?
*from Kotlin, that is
s
I’m not sure, needs investigation.
n
Got it, let me file a ticket to keep track of it.
🆗 1
@svyatoslav.scherbina so while trying to create an isolated reproducer, I just couldn’t. This doesn’t happen in a new project.
it seems to be okay even with the default deployment target of 9
I believe seeing raw
ld
invocations could help 🤔
s
so while trying to create an isolated reproducer, I just couldn’t. This doesn’t happen in a new project.
I guess I have one:
Copy code
~/.konan/kotlin-native-prebuilt-macos-1.4.32/bin/kotlinc-native -target ios_x64 test.kt -linker-option -ios_simulator_version_min -linker-option 10.0.0
where
test.kt
is
Copy code
fun main() {
    println(platform.Foundation.NSURLSessionTaskTransactionMetrics)
}
n
@svyatoslav.scherbina thank you, here goes the ticket: https://youtrack.jetbrains.com/issue/KT-46282
s
Thanks!