JetBrains / kotlin-native

Kotlin/Native infrastructure
Apache License 2.0
7.02k stars 566 forks source link

linkTestDebugExecutableIos FAILED : Undefined symbols for architecture x86_64 #3299

Closed jittya closed 5 years ago

jittya commented 5 years ago

Task :app:iosMainKlibrary Task :app:linkTestDebugExecutableIos Undefined symbols for architecture x86_64: "_OBJCCLASS$_UIDevice", referenced from: objc-class-ref in combined.o ld: symbol(s) not found for architecture x86_64 e: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld invocation reported errors

Task :app:linkTestDebugExecutableIos FAILED

SvyatoslavScherbina commented 5 years ago

Known issue. Add this to your ios target configuration in Gradle build script:

binaries.getByName("testDebugExecutable").linkerOpts("-framework UIKit")
jittya commented 5 years ago

@SvyatoslavScherbina Worked!!!

ArthurBrum commented 4 years ago

What if I need to link more than one framework like this? UIKit, Foundation, AVFoundation... etc

SvyatoslavScherbina commented 4 years ago

What if I need to link more than one framework like this?

Why do you ask? Have you encountered a similar problem with other framework?

This particular issue can happen only with system frameworks, and UIKit is the only known example.

ArthurBrum commented 4 years ago

Well, I just had to link things correctly, you already helped me here: https://github.com/JetBrains/kotlin-native/issues/3096#issuecomment-584028554