https://kotlinlang.org logo
Docs
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
kotlin-native
  • v

    Vlad Balan

    03/04/2020, 7:14 AM
    Hi guys, I am trying to debug
    kotlin-native
    by using the
    Native Debugging Support
    plugin, but I get the following Error when running the target in debug mode:
    Error running 'x64.test': com/jetbrains/cidr/ArchitectureType
    Running it in run mode works fine Does anybody know why I get this error? Thanks in advance!
    m
    k
    15 replies · 3 participants
  • a

    andreasmattsson

    03/04/2020, 9:58 AM
    Crashed: org.reactivecocoa.ReactiveObjC.RACScheduler.mainThreadScheduler
    0  Deedster                       0x1035e88ec (anonymous namespace)::garbageCollect(MemoryState*, bool) + 4314450156
    1  Deedster                       0x1035f8b40 ObjHeader* (anonymous namespace)::allocInstance<true>(TypeInfo const*, ObjHeader**) + 4314516288
    2  Deedster                       0x1030749c0 kfun:kotlinx.serialization.json.JsonObject.$toString$lambda-0$FUNCTION_REFERENCE$380.invoke#internal + 4308732352
    3  Flutter                        0x104c5dbcc (Missing)
    4  Deedster                       0x1033bd8c8 kfun:se.sdg12.deedster.flutter.channel.BlockFunctionImpl351.$<bridge-UNNN>invoke(kotlin.Any?)#internal + 4312176840
    5  Deedster                       0x102dd6230 partial apply for closure #1 in RacObservableMethodsIos.subscribe(receiver:next:error:completed:) + 262 (RxObservable+Utils.swift:262)
    6  Deedster                       0x102dd1e44 thunk for @escaping @callee_guaranteed (@guaranteed Swift.AnyObject?) -> () + 4305968708 (<compiler-generated>:4305968708)
    7  ReactiveObjC                   0x10594c500 -[RACSubscriber sendNext:] + 120
    I found a few closed issues on the Kotlin Native github referring to
    garbageCollect
    but they were closed as having been fixed / not reproducible in Kotlin 1.3.61, but that is already the version we are running.
    r
    8 replies · 2 participants
  • a

    andreasmattsson

    03/04/2020, 9:58 AM
    Hi guys! We've been getting an increasing amount of crash reports (via Crashlytics) in our production app with Kotlin Native as a static framework, of a type we have been unable to reproduce with the debugger attached / on our own devices. All of them
    EXC_BAD_ACCESS KERN_INVALID_ADDRESS
    and pointing to
    (anonymous namespace)::garbageCollect(MemoryState*, bool)
    Any suggestions for how to troubleshoot this? It seems to be happening in pretty random places (e.g. the rest of the stack can look quite different from place to place, and analytics events suggests it is happening in a bunch of different views. A few more (partial) sample stack traces:
    Crashed: com.apple.main-thread
    0  Deedster                       0x1051847e4 (anonymous namespace)::garbageCollect(MemoryState*, bool) + 4313057252
    1  Deedster                       0x105194b40 ObjHeader* (anonymous namespace)::allocInstance<true>(TypeInfo const*, ObjHeader**) + 4313123648
    2  Deedster                       0x104a7fbd0 kfun:kotlin.collections.HashMap.hash#internal + 4305697744
    3  CoreFoundation                 0x193fa9938 -[NSDictionary getObjects:andKeys:count:] + 240
    4  CoreFoundation                 0x194114064 __NSDictionaryEnumerate + 624
    5  Foundation                     0x194530f50 _writeJSONObject + 424
    6  Foundation                     0x194531d1c ___writeJSONArray_block_invoke + 268
    7  CoreFoundation                 0x19409995c __NSARRAY_IS_CALLING_OUT_TO_A_BLOCK__ + 16
    0   Deedster                       0x100a507e4 (anonymous namespace)::garbageCollect(MemoryState*, bool) + 4381165540
    1   Deedster                       0x100883658 objc2kotlin.3124 + 4379276888
    2   ReactiveSwift                  0x102ed9068 $s13ReactiveSwift6SignalC2on5event6failed9completed11interrupted10terminated8disposed5valueACyxq_GyAC5EventOyxq__GcSg_yq_cSgyycSgA3RyxcSgtFyAC8ObserverCyxq__G_AA8LifetimeCtXEfU_yAOcfU_ + 488
    3   ReactiveSwift                  0x102eea9a4 $s13ReactiveSwift6SignalC2on5event6failed9completed11interrupted10terminated8disposed5valueACyxq_GyAC5EventOyxq__GcSg_yq_cSgyycSgA3RyxcSgtFyAC8ObserverCyxq__G_AA8LifetimeCtXEfU_yAOcfU_TA + 52
    4   ReactiveSwift                  0x102ebfc28 $s13ReactiveSwift6SignalC8ObserverC4sendyyAC5EventOyxq__GF + 40
    5   ReactiveSwift                  0x102ed3604 $s13ReactiveSwift6SignalC4Core33_6DF632AE8A9288C3EAD8EFDF3D3AF99ELLC4sendyyAC5EventOyxq__GF + 780
    6   ReactiveSwift                  0x102ebfc28 $s13ReactiveSwift6SignalC8ObserverC4sendyyAC5EventOyxq__GF + 40
    7   ReactiveSwift                  0x102ef1354 $s13ReactiveSwift15TransformerCore33_8C2AEE826CBF26B7535B1491D314A4F4LLC5startyAA10Disposable_pAA6SignalC8ObserverCyxq__GAaF_pXEFAJyq0_q1__GAaF_pXEfU_yAH5EventOyxq__GcfU_ + 84
    Crashed: com.apple.main-thread
    0  Deedster                       0x1017e47e4 (anonymous namespace)::garbageCollect(MemoryState*, bool) + 4388997092
    1  Deedster                       0x1017f490c ReleaseHeapRefStrict + 4389062924
    2  Deedster                       0x1017f1a64 ReadHeapRefLocked + 4389050980
    3  Deedster                       0x10114c7d4 kfun:kotlinx.coroutines.CancellableContinuationImpl.<get-state>$kotlinx-coroutines-core()kotlin.Any? + 4382083028
    4  Flutter                        0x102fb532c (Missing)
    5  Flutter                        0x102f558fc (Missing)
    6  Flutter                        0x102fa68dc (Missing)
    7  Flutter                        0x102f63628 (Missing)
    a
    s
    21 replies · 3 participants
  • k

    Kris Wong

    03/04/2020, 8:26 PM
    you know, it's really quite a pain to have to check if all of the dependencies for all of my KMP modules have been updated after each new release
    💯 1
    b
    r
    +2
    11 replies · 5 participants
  • s

    spierce7

    03/04/2020, 10:11 PM
    In 1.3.70 I’m getting compilation errors due to compilation versions not matching because I’m still trying to use
    1.3.3-native-mt
    of coroutines. @elizarov Is there an equivalent for 1.3.70?
    r
    e
    +1
    6 replies · 4 participants
  • l

    Lorin

    03/05/2020, 1:33 AM
    Hi JetBrains,   Is it possible to make Kotlin/Native the first-class programming language just like Golang in k8s world?   If so, we could use Kotlin/Native to implement the aggregation api-server or some plugins as k8s extensions. That would be great!
    e
    1 reply · 2 participants
  • n

    napperley

    03/06/2020, 1:06 AM
    Attempting to use libcurl to do a HTTP POST but end up with this response from the Prometheus server:
    {
      "status": "error",
      "errorType": "bad_data",
      "error": "invalid parameter 'query': parse error at char 1: no expression found in input"
    }
    Can someone please confirm if I have correctly set the headers/body for the HTTP request. Below is the Kotlin code I am using:
    fun doHttpPost(url: String, headers: Map<String, String>, body: Map<String, String>): Unit = memScoped {
        val headersList = alloc<curl_slist>()
        headers.forEach { (k, v) -> curl_slist_append(headersList.ptr, "$k: $v") }
        curl_easy_setopt(curlPost, CURLOPT_URL, url)
        curl_easy_setopt(curlPost, CURLOPT_HTTPHEADER, headersList.next)
        curl_easy_setopt(curlPost, CURLOPT_POSTFIELDS, createPostBody(body))
        // Do HTTP POST.
        curl_easy_perform(curlPost)
    }
    
    fun createPostBody(args: Map<String, String>) = buildString {
        args.forEach { (k,v) -> append("&$k=$v") }
    }.replaceFirst("&", "")
    Originally
    headersList.ptr
    was passed as an argument to
    curl_easy_setopt
    however that caused a seg fault. Fixed the seg fault by passing through
    headersList.next
    instead, although I am not sure if that is the correct way to do it.
    5 replies · 1 participant
  • r

    raniejade

    03/06/2020, 3:34 AM
    In the
    1.3.70
    release notes for kotlin native (https://github.com/JetBrains/kotlin-native/blob/master/CHANGELOG.md), there is an entry that piqued my interest:
    On-stack allocation using local escape analysis (GH-3625)
    . Can anyone from the KN team elaborate more on this? (maybe @olonho?)
    s
    n
    7 replies · 3 participants
  • n

    Nikola Milovic

    03/06/2020, 6:23 AM
    Hey guys, can anyone explain to me, from android dev perspective, what is kotlin native? I read about it and i get the point that it compiles to native binaries, but is there something else to it. If i started typing it now how would it differ from regular android targeting code? Edit: basically the same just without the middleman JVM?
    f
    d
    +1
    5 replies · 4 participants
  • s

    swishy

    03/06/2020, 9:25 PM
    Hi All, Im currently doing XML passing on Mac and passing the actual parsing off to NSXML as follows
    actual fun parse(xml: String) {
    
        xml.usePinned {
            val bytes = it.get().encodeToByteArray()
            val pointer = StableRef.create(bytes)
            val data = NSData.dataWithBytes(pointer.asCPointer(), bytes.size.toULong())
            this.parser = NSXMLParser(data = data)
            this.parser.delegate = this
            this.parser.parse()
        }
    
        this.parser.setDelegate(null)
    
        println("Parsing Done")
    }
    Delegate get called for start doc but then parsing fails with NSXMLParserErrorDomain error 4. which would indicate the NSData was empty but it doesnt appear to be the case, is there something Im missing?
    1 reply · 1 participant
  • t

    Thomas

    03/06/2020, 10:25 PM
    Hi, I am getting the following error when compiling for watchosX86 with Kotlin 1.3.70:
    fatal error: error in backend: Section too large, can't encode r_address (0x10022e9) into 24 bits of scattered relocation entry.
    Does anyone know what this means? It only happens for the simulator. If I build for watchosArm64 there are no issues. Also when I build in release mode the issue is gone. https://kotlinlang.slack.com/archives/C3SGXARS6/p1578922829122300?thread_ts=1578912211.116800&amp;cid=C3SGXARS6
    a
    3 replies · 2 participants
  • a

    Animesh Sahu

    03/07/2020, 2:53 PM
    Hi guys sb know how to run/debug a k/Native project, my intellij idea doesn't show run button in from of main function.
    n
    s
    16 replies · 3 participants
  • n

    napperley

    03/08/2020, 3:28 AM
    Using the following code to set the body for a HTTP POST request:
    curl_easy_setopt(curlPost, CURLOPT_POSTFIELDS, createPostBody(body).cstr)
    Is this the correct way to do it? With the verbose option for libcurl enabled the library prints out 6 for the content length (based on query=up), however the Prometheus server reports that the HTTP request body is missing.
    a
    5 replies · 2 participants
  • a

    Animesh Sahu

    03/08/2020, 4:44 AM
    How can we do silent installation of a setup.exe (multiple) into host computer, based on how much application user has choosen.
    🤔 1
    2 replies · 1 participant
  • j

    Julio Zynger

    03/08/2020, 5:31 PM
    Suppose I have a KMP project with a Kotlin Native target, is it possible to include “more files” other than Kotlin? Concretely, I want to include a manually written Objective-C or Swift facade class to sit on top of the generated KN headers. Is that something supported?
    k
    4 replies · 2 participants
  • e

    evant

    03/09/2020, 12:45 AM
    just ran into the missing libtinfo5 problem again which seems to be pretty common, would be nice for kotlin native tooling to be updated so that this isn't an issue.
    s
    2 replies · 2 participants
  • s

    swishy

    03/10/2020, 4:46 AM
    Anyone else having issues with Konanc going to lunch linking on mingw64 builds? - trying to run tests and it hangs linking the test executable. Currently using multiplatform 1.3.70
    a
    15 replies · 2 participants
  • r

    russhwolf

    03/10/2020, 4:00 PM
    Is it possible to export transitive dependencies to Apple frameworks when using the cocoapods gradle plugin? Can't use the syntax described at https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#exporting-dependencies-to-binaries because the
    framework
    block is handled internally by the plugin. And doing something like
    targets.getByName<KotlinNativeTarget>("ios").binaries.getFramework("DEBUG").transitiveExport = true
    doesn't appear to have any effect.
    b
    s
    28 replies · 3 participants
  • v

    Vlad Balan

    03/10/2020, 4:44 PM
    Hi guys, I am trying to return to a C++ program a struct pointer allocated in Kotlin Native. The struct:
    typedef struct {
        uint8_t a;
    } testStructDto;
    is translated in Kotlin as follows:
    @kotlinx.cinterop.internal.CStruct public final class testStructDto public constructor(rawPtr: kotlinx.cinterop.NativePtr /* = kotlin.native.internal.NativePtr */) : kotlinx.cinterop.CStructVar {
        public companion object : kotlinx.cinterop.CStructVar.Type {
        }
    
        public final var a: liboverlay.uint8_t /* = kotlin.UByte */ /* compiled code */
    }
    My Kotlin native function:
    @ExperimentalUnsignedTypes
    	override fun init(): CPointer<testStructDto> {
    		val dtoVar = nativeHeap.alloc<testStructDto>()
    		dtoVar.a = 0xa5.toUByte()
    
    		return dtoVar.ptr
    	}
    I can use it in Kotlin like this:
    @Test
    	fun `initialize`() {
    		val context = controller.init()
    
    		assertEquals(0xa5.toUByte(), context.pointed.a)
    	}
    But when I try to use it in C like this:
    libtest_ExportedSymbols *libPtr = libtest_symbols()
    libtest_kref_MyObjectFactory kFactory = libPtr->kotlin.root.MyObjectFactory._instance();
    libtest_kref_MyObject kObject = libPtr->kotlin.MyObjectFactory.create(kFactory);
    testStructDto *dto = (testStructDto *) libPtr->kotlin.root.MyObject.init(kObject);
    I always get
    dto->a = 32
    I get the value
    32
    even if I assign something else than
    0xa5
    . Does anybody know what I am doing wrong? Thanks in advance!
    a
    3 replies · 2 participants
  • s

    sean

    03/10/2020, 5:37 PM
    Is there an arg parge library for kotlin native, or has anyone started working on one?
    r
    j
    +1
    5 replies · 4 participants
  • s

    serebit

    03/10/2020, 9:15 PM
    If I'm using Kotlin/Native with GTK, and storing pointers to widgets (those pointers being given by
    gtk_new
    builder functions) in a Kotlin class, how can I ensure that the pointers are being freed by program exit? If they were being allocated by Kotlin/Native and not GTK, I could use
    nativeHeap.free
    , but I'm not sure how to handle it in this case.
    k
    k
    +1
    14 replies · 4 participants
  • t

    tylerwilson

    03/12/2020, 2:25 PM
    Just moved to Kotlin 1.3.70 and trying to run iOSFrameworkTask in AS, I get this:
    e: java.lang.IllegalStateException: Symbol for deserialized  class Boolean is unbound
    anybody have any clue? It is not showing me what file it is failing on (just shows a list of all kt files). Thanks!
    e
    3 replies · 2 participants
  • p

    Patrick

    03/13/2020, 2:00 PM
    Has anyone seen this error before? It happens on Windows if you try to compile a function with the CoGetClassObject function in it.
    C:\Users\patri\AppData\Local\Temp\konan_temp5624724293383525973\result.o:out:(.text+0x3b70f3): undefined reference to `__imp_CoGetClassObject'
    clang++: error: linker command failed with exit code 1 (use -v to see invocation)
    e: C:\Users\patri\.konan\dependencies\msys2-mingw-w64-x86_64-clang-llvm-lld-compiler_rt-8.0.1/bin/clang++ invocation reported errors
    a
    2 replies · 2 participants
  • k

    kevin.cianfarini

    03/13/2020, 2:13 PM
    is there any way to encapsulate manual memory management? The only thing I can think of is to hook into the GC cycle and free memory when an object is getting collected. This is essentially a finalizer though, which are evil. Has anyone figured out a better way to do this so manual memory management doesn't pollute a whole codebase?
    a
    a
    +2
    34 replies · 5 participants
  • s

    spierce7

    03/13/2020, 8:00 PM
    Is it possible to get code completion in the IDE with c headers? I’m doing the following, but I’m getting no code completion:
    kotlin {
        android {
            compilations.all {
                kotlinOptions.jvmTarget = "1.8"
            }
            publishAllLibraryVariants()
        }
        ios {
            compilations.all {
                cinterops {
                    create("firebasecore") {
                        packageName("cocoapods.FirebaseCore")
                        defFile = File("$projectDir/src/iosMain/c_interop/FirebaseCore.def")
                        includeDirs ("$projectDir/../iosApp/Pods/FirebaseCore/Firebase/Core/Public")
                        compilerOpts ("-F$projectDir/src/iosMain/c_interop/modules/FirebaseCore-6.0.2")
                    }
                    create("firestore") {
                        packageName("cocoapods.FirebaseFirestore")
                        defFile = File("$projectDir/src/iosMain/c_interop/FirebaseFirestore.def")
                        includeDirs ("$projectDir/../iosApp/Pods/FirebaseFirestore/Firestore/Source/Public", "$projectDir/../iosApp/Pods/FirebaseCore/Firebase/Core/Public")
                        compilerOpts ("-F$projectDir/src/iosMain/c_interop/modules/FirebaseFirestore-1.3.2")
                    }
                }
            }
        }
        // ...
    }
    1 reply · 1 participant
  • m

    Martin Gagnon

    03/16/2020, 12:35 PM
    Hi, I'm having trouble updating to kotlin 1.3.70 and I can't get around this issue.
    linkDebugFrameworkIos
    fails with "ld invocation reported errors" without any outputs. `linkReleaseFrameworkIos`` work really well. The issue arise as soon as I import the common dependency of
    Trikot.foundation
    one of our shared code library (build.gradle -> https://github.com/mirego/trikot.foundation/blob/upgrade/kotlin-1.3.70/foundation/build.gradle ). The library is imported as follow:
    sourceSets {
            commonMain {
                dependencies {
                    api "com.mirego.trikot:foundation:$trikot_foundation_version"
    Any help or hints would be appreciated. It was working A1 in 1.3.61 and before. Cheers!
    a
    a
    9 replies · 3 participants
  • r

    ritesh

    03/16/2020, 2:01 PM
    I have a domain module (contains model and use-cases) and ui-module, ui-module is dependent on domain module. I need to parcelize one of the model of domain-module, but to use it, i need to convert it to android library to take leverage of
    @Parcelize
    Any way, can i make use of
    typealias
    and
    expect
    and
    actual
    without converting the domain pure kotlin module to android module?
    r
    a
    7 replies · 3 participants
  • k

    Kurt Renzo Acosta

    03/17/2020, 5:15 AM
    When I have a sealed class in my module, I can perfectly use it in Kotlin/Native interoperable with Swift but if I use a sealed class from a library, I can use it in K/N but I can't seem to find the subclasses in Swift. Has anybody encountered this?
    1 reply · 1 participant
  • p

    Patrick

    03/17/2020, 10:06 AM
    This error suddenly appeared on windows if I try to run the executable. Any ideas why this happens?
    The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail.
    1 reply · 1 participant
  • r

    ribesg

    03/17/2020, 1:07 PM
    I’m updating from 1.3.61 to 1.3.70 and I encounter an error during the linking phase
    linkDebugExecutableIos
    . It says
    e: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld invocation reported errors
    but there is no logs, so I don’t see what reported errors it’s about. Is there a way to obtain more logs? Passing --debug to gradle doesn’t do anything as I guess the error is in the call to
    konanc
    e
    40 replies · 2 participants
Powered by Linen
Title
r

ribesg

03/17/2020, 1:07 PM
I’m updating from 1.3.61 to 1.3.70 and I encounter an error during the linking phase
linkDebugExecutableIos
. It says
e: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld invocation reported errors
but there is no logs, so I don’t see what reported errors it’s about. Is there a way to obtain more logs? Passing --debug to gradle doesn’t do anything as I guess the error is in the call to
konanc
Are there arguments you can pass to
konanc
to get logs?
e

Elena Lepilkina

03/17/2020, 3:16 PM
Printing of linker error should be fixed in
1.3.71
To get an error with
1.3.70
you should get konanc arguments from gradle log (use
./gradlew -i ...
) anf run this konanc command line from terminal.
r

ribesg

03/17/2020, 3:48 PM
Thanks @Elena Lepilkina, I now see the warnings I always see (conflicting ids etc) but there is still no error. When ran from a terminal, the process just seem to quit
e

Elena Lepilkina

03/17/2020, 3:50 PM
Are you sure that you use the right konan command? Because there are several commands in log
r

ribesg

03/17/2020, 3:51 PM
I’m using the one printed directly above
e: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld invocation reported errors
e

Elena Lepilkina

03/17/2020, 3:52 PM
That is very strange. Could you share somehow your project?
r

ribesg

03/17/2020, 3:54 PM
No that’s not possible
Wait, when I run
echo $?
after running the command it prints
0
So running the command in the terminal does work
That’s why it’s not printing errors
e

Elena Lepilkina

03/17/2020, 4:07 PM
So it's wrong command line, could you share you log at least?
r

ribesg

03/17/2020, 4:12 PM
Here’s what I ran in the terminal and the output
Sans titre
(The conflicting ids warning has been here forever and never was a problem)
Here’s what I see in XCode logs
The command I ran is copied from the line with “more” at the end
e

Elena Lepilkina

03/17/2020, 4:39 PM
It looks very strange, but if you got zero exit code it should produce executable. Is executable built or not?
Also if separate command from terminal works properly, could you please check
./gradlew --stop
./gradlew -Pkotlin.native.disableCompilerDaemon=true <your task and options>
r

ribesg

03/18/2020, 8:37 AM
@Elena Lepilkina using that I’m now able to see the linker logs in XCode, thanks 🙂
So something changed and pod frameworks got moved somehow I just need to adapt my script to the new location Well actually the directory exists and contains the framework so that’s weird
Ok I changed
-F"<path>"
to
-F<path>
and it now seem to work again. Hopefully I never get any space in this path though 😕 Not sure what changed and why but that worked with Kotlin 1.3.61
e

Elena Lepilkina

03/18/2020, 9:00 AM
Now this option is sent via
linker-option
, to work with spaces you should use
"-F<path>"
. Where is this property set?
r

ribesg

03/18/2020, 9:02 AM
Now it’s set here
binaries.executable(listOf(buildType)) {
            baseName = "app"
            linkerOpts(
                "-F$podsBuildDir/MaterialComponents",
                "-F$carthageBuildDir"
            )
        }
But if
podsBuildDir
contains spaces it will now fail (not in this project though). Do you mean I should be able to use
"\"-F$podsBuildDir/MaterialComponents\""
?
e

Elena Lepilkina

03/18/2020, 9:06 AM
Have you tried? It seems that now with your script there shouldn't be problems with spaces. If you have such problems, we'll fix them
r

ribesg

03/18/2020, 9:12 AM
I just tried and it doesn’t work. But that’s not a big issue, it works without
"
in this specific case and I should be able to use something like
.replace(" ", "\ ")
if I need to. I just liked the natural solution of wrapping the argument in
"
better
e

Elena Lepilkina

03/18/2020, 9:14 AM
Ok, thank you, we'll check and try to fix this.
👍 1
You mentioned before that if you use in
linkerOpts
"-F<path>" and path contains spaces linker fails. I checked and I couldn't reproduce this behaviour linker option is passed right way with spaces. Could you share project to reproduce?
r

ribesg

03/26/2020, 9:06 AM
Sorry but I won’t be able to do that as I am back at 1.3.61 as 1.3.70 causes too many complicated errors. I did just that
"\"-F$podsBuildDir/MaterialComponents\""
and it didn’t work in my case, not sure why but I can’t share my project
e

Elena Lepilkina

03/26/2020, 9:08 AM
No it should work properly with "-F$podsBuildDir/MaterialComponents" even with spaces. Did you check it? If no, I checked and it works
r

ribesg

03/26/2020, 9:33 AM
linkerOpts("-F$podsBuildDir/MaterialComponents")
or
linkerOpts("\"-F$podsBuildDir/MaterialComponents\"")
? That’s not the same thing
First one works in 1.3.70, second one didn’t. That’s what I remember, can’t test it anymore
e

Elena Lepilkina

03/26/2020, 9:36 AM
linkerOpts("-F$podsBuildDir/MaterialComponents")
this is right, it works for cases with spaces also.
Ok, if you have problem with spaces in first later, please, let us know
r

ribesg

09/15/2020, 1:59 PM
@Elena Lepilkina Hey remember this? I’m finally trying to update from 1.3.61 again, to 1.4.10 this time. And I still have this problem
e

Elena Lepilkina

09/15/2020, 2:04 PM
Do you use
linkerOpts("-F$podsBuildDir/MaterialComponents")
?
r

ribesg

09/15/2020, 2:06 PM
Well I just checked and, no 🙂 I changed it in one place but not the other. Hopefully this works.
I still had my
\"
somewhere
Yeah it compiles. And then doesn’t run because of another new 1.4 bug, but at least this one looks fixed!
👌 1
View count: 7