question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Undefined symbols for _kfun:platform.darwin.objcKniBridge77$darwin(kotlin.native.internal.NativePtr;kotlin.native.internal.NativePtr)platform.darwin.NSObject?

See original GitHub issue

I’m following client-mpp sample in my MPP project, which generates an Android AAR and iOS framework. The version information is as follows:

buildscript {
    ext.kotlin_version = '1.3.0-rc-57'
    ext.kotlin_native_version = '0.9.2'
    ext.serialization_version = '0.8.1-rc13'
    ext.ktor_version = "0.9.5-rc13"
    ext.android_gradle_version = '3.2.0'
}

ktor is my second dependency after serialization. Serialization works without problems on both iOS and Android. After adding dependency on ktor, I got IosClientEngine-related error when building iOS framework (Android AAR is generated without problems).

> Task :ios:compileDebugIos_x64KotlinNative
Undefined symbols for architecture x86_64:
  "_kfun:platform.darwin.objcKniBridge77$darwin(kotlin.native.internal.NativePtr;kotlin.native.internal.NativePtr)platform.darwin.NSObject?", referenced from:
      _kfun:io.ktor.client.engine.ios.IosClientEngine.object-1.<init>#internal in combined.o
ld: symbol(s) not found for architecture x86_64
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld invocation reported errors

> Task :ios:compileDebugIos_x64KotlinNative FAILED

What should I do to resolve it?

Thank you in advance!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Alex009commented, Oct 6, 2018

same problem. i fix it when set this versions:

ext {
    kotlin_version = '1.3.0-rc-57'
    kotlin_native_version = '0.9.2'
    coroutines_version = '0.26.1-rc-conf2'
    serialization_version = '0.8.1-rc13'
    ktor_version = '0.9.5-rc13-conf2'
}

but in runtime coroutines fail with

kotlin.native.IncorrectDereferenceException: Trying to access top level value not marked as @ThreadLocal or @SharedImmutable from non-main thread

on

#2	0x0000000106f8324a in ThrowIncorrectDereferenceException at /opt/teamcity-agent/work/4d622a065c544371/runtime/src/main/kotlin/kotlin/native/internal/RuntimeUtils.kt:75
#3	0x0000000106f9ee9a in CheckIsMainThread ()
#4	0x0000000106fd7c0f in kfun:kotlinx.coroutines.<get-EMPTY_ACTIVE>#internal at /Users/qwwdfsad/workspace/kotlinx.coroutines2/common/kotlinx-coroutines-core-common/src/JobSupport.kt:1050
#5	0x0000000106fe7507 in kfun:kotlinx.coroutines.JobSupport.<init>(kotlin.Boolean)kotlinx.coroutines.JobSupport at /Users/qwwdfsad/workspace/kotlinx.coroutines2/common/kotlinx-coroutines-core-common/src/JobSupport.kt:84
#6	0x0000000106ff0608 in kfun:kotlinx.coroutines.CompletableDeferredImpl.<init>#internal at /Users/qwwdfsad/workspace/kotlinx.coroutines2/common/kotlinx-coroutines-core-common/src/CompletableDeferred.kt:62
#7	0x0000000106ff056a in kfun:kotlinx.coroutines.CompletableDeferred(kotlinx.coroutines.Job?)Generic at /Users/qwwdfsad/workspace/kotlinx.coroutines2/common/kotlinx-coroutines-core-common/src/CompletableDeferred.kt:43
#8	0x0000000106ff26d0 in kfun:kotlinx.coroutines.CompletableDeferred$default(kotlinx.coroutines.Job?;kotlin.Int)Generic at /Users/qwwdfsad/workspace/kotlinx.coroutines2/common/kotlinx-coroutines-core-common/src/CompletableDeferred.kt:38
0reactions
yurirycommented, Oct 10, 2018

I whish I could migrate to kotlin_version=1.3.0-rc-131 and serialization_version=0.8.2-rc13 but I can’t because of this problem

Read more comments on GitHub >

github_iconTop Results From Across the Web

Kotlin Multiplatform - Objective-C interoperability architecture ...
Kotlin Multiplatform - Objective-C interoperability architecture issue Undefined symbols for architecture x86_64 · Ask Question. Asked 1 year, 9 ...
Read more >
Kotlin Native
Kotlin Native. Kotlin/Native is a technology for compiling Kotlin code to native binaries which can run without a virtual machine.
Read more >
Kotlin Multiplatform Project for Android and iOS: Getting Started
Thanks to Kotlin/JVM, Kotlin/JS and Kotlin/Native, ... It isn't possible to use platform-specific code inside the common module, but Kotlin ...
Read more >
Building Multiplatform Project on Kotlin/Native - Medium
The common module can declare the expected declaration that has the actual realization in the platform modules. By the expect keyword we can ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found