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
multiplatform
  • s

    Steven

    04/16/2019, 4:03 PM
    i am trying to use the new cocoapods plugin with the example here https://github.com/JetBrains/kotlin-native/blob/master/samples/cocoapods/kotlin-library/build.gradle.kts. Can anyone help me translate kotlin syntax to groovy? specifically line 22
    val iOSMain by sourceSets.creating
    h
    • 2
    • 10
  • i

    ivan.savytskyi

    04/16/2019, 6:50 PM
    We noticed that for some reasons the gradle daemon is getting freezing for MPP project. Only kill the process and re-start build helps. Is there any known issue? Kotlin 1.3.21. It’s unclear what causes this, as it happens not regularly. Project is quite large: ~50 modules, with 1 module that is MPP
    l
    • 2
    • 3
  • r

    Robert

    04/16/2019, 7:45 PM
    I somehow remember that someone said it was internally working on a library on Kotlin and Protobuf, but can't find any reference. Can someone redirect me to the right person(s)?
    l
    g
    • 3
    • 4
  • s

    sunbreak

    04/17/2019, 2:39 AM
    Hi everyone! I find there is a lack of boilerplates for MPP project by "Kotlin-DSL". Made up one by myself: https://github.com/woodemi/notepad-sdk-mpp Features: - Totally by "Kotlin-DSL" - Using "Composite build" of Gradle for clear directory architecture References: - IntelliJ's template "Mobile Android/iOS" and "Mobile Shared Library" - AppCode's template "Single View App With a Kotlin/Native Framework" - https://kotlinlang.org/docs/reference/multiplatform.html - https://github.com/JetBrains/kotlin-mpp-example Hope it helps 🙂
    👏 3
    😍 1
    g
    a
    • 3
    • 3
  • g

    galex

    04/17/2019, 3:54 AM
    Please like this bug so we can push it! 💪 💪 https://youtrack.jetbrains.com/issue/KT-27801
    👍 1
    h
    d
    • 3
    • 3
  • m

    mben

    04/17/2019, 11:59 AM
    Hello i have a question about testing common module do you use any available lib to do it once or you write tests for each platform? i tried mockk but couldn't succeed to make it work
    g
    p
    • 3
    • 2
  • m

    Mohammadsss1

    04/17/2019, 2:36 PM
    Hi everyone, I am stuck at the step of generating the frameworks for iOS in both debug & release. I read here that the Gradle script “creates a debug and release version for every framework target.” How to generate the these frameworks? https://kotlinlang.org/docs/tutorials/native/mpp-ios-android.html
    s
    s
    • 3
    • 9
  • s

    Shan

    04/18/2019, 2:01 PM
    Hey all. Should my target artifacts have a Maven dependency on Common? It's not registering when I create the Pom, not sure if that's intended or not. (I'm having issues with my project, where gradle will import the dependency fine but my project cannot find the package, which is why I ask)
    h
    • 2
    • 9
  • s

    Shan

    04/18/2019, 10:22 PM
    From the MPP guide: "By default, a sources JAR is added to each publication in addition to its main artifact." Does this mean I don't need to include
    from(components["java"])
    and
    artifact(tasks["sourcesJar"])
    within my maven publication in my MPP build file?
    s
    h
    • 3
    • 7
  • r

    Rainer Schlonvoigt

    04/19/2019, 6:22 AM
    nice, if you have a method with way too many params (e.g. 12) and one of them is a primitive (e.g. Int) then when running the code on Android, the class will fail verification when it is loaded at runtime
    l
    • 2
    • 1
  • p

    pardom

    04/19/2019, 7:06 PM
    Does anyone know of a
    common
    implementation of
    URI
    ?
    d
    • 2
    • 2
  • n

    Nikolai

    04/20/2019, 1:52 PM
    Hello everyone, we submitted app to App Store, but Apple rejected it with message :
    We discovered that your app contains obfuscated code, selector mangling, or features meant to subvert the App Review process by changing this app's concept after approval to the App Store.
    
    The next submission of this app may require a longer review time, and this app will not be eligible for an expedited review until this issue is resolved.
    Is where any chance that it was caused by app.framework that was built in multiplatform project?
    😨 7
    o
    s
    • 3
    • 9
  • p

    Patrick Jackson

    04/21/2019, 12:52 AM
    I recently found that regex on multiplatfrom appears to be use the platforms regex engine, which can mean you will need different expressions for each platform. At least this is the case for JS, JVM, & iOS. Any plans to implement a common regex engine?
    🤔 1
    d
    g
    • 3
    • 5
  • n

    Nikolai

    04/22/2019, 2:39 AM
    Hi, everyone, I this post a little bit different, sorry if writing in different thread. We started to work with Kotlin Multiplatform as soon as it was announced for the first time. And not so far time ago we managed to submit our first app that was developed with multiplatform approach to Play Market. We put all client/server communication and screen logic inside common module. And on native platfroms we implemented only views. We have some difficulties with Apple review, but I think we will pass it. I just wanted to say
    Thank You
    to everyone who worked on this technology and everyone who helping other peoples here in Slack (in this and any other channels). We had a lot of questions, issues and troubles during our development and it’s great that you can came here and ask question. Than You all.
    👏 13
    👍 14
    :kotlin: 14
    o
    • 2
    • 1
  • m

    Mohammadsss1

    04/22/2019, 10:17 AM
    Hello all, Are we able to have symbolicated crash logs from release iOS apps? I have uploaded a TestFlight build with a Kotlin framework. There is a function that I call to cause an exception. However, the stack trace seems wrong in terms of line number. In addition, does KN provide the line of code for the crashed Kotlin code?
    -.kt
    t
    • 2
    • 1
  • p

    Patrick Jackson

    04/22/2019, 10:54 PM
    With MP libs, will all dependencies have to match compiler versions? or are there just certain incompatibilities between some versions of the compiler? I have had some compile time errors due to my compiler version not matching the compiler version of the library.
    d
    o
    • 3
    • 2
  • l

    LeoColman

    04/23/2019, 1:39 PM
    I'm working with a project that have a global
    apply plugin: 'kotlin'
    .
    g
    • 2
    • 2
  • l

    LeoColman

    04/23/2019, 1:39 PM
    In one of it's submodules, I'm trying to apply the kotlin-mpp plugin, but it fails saying that kotlin extension is already declared. What can I do to use the mpp plugin only on the submodule, without changing how the
    subprojects
    is configured?
    g
    • 2
    • 6
  • k

    Konstantin Tskhovrebov

    04/23/2019, 8:26 PM
    Hello! I try to use
    kotlinx.serialization
    for protobuf serialization, but it's not support enum ids 😢 Any news about it? PS: jvm + web platforms at the moment
    e
    g
    • 3
    • 2
  • r

    ribesg

    04/24/2019, 8:22 AM
    I’m still blocked by this. I really don’t know what’s causing this, but I feel like it would not happen in a pure JVM context. At this point I’m trying to change Gradle and JDK versions to see what happens. Random but I don’t know
    m
    • 2
    • 6
  • r

    rudolf.hladik

    04/24/2019, 1:52 PM
    i don’t know why, but gradle doesn’t want to download
    org.jetbrains.kotlinx:kotlinx-coroutines-core-native
    dependency and don’t even throw an error. I have
    iosMain.dependencies {
                implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-native:1.2.0"
    }
    and in buildscript
    buildscript {
        repositories {
            maven { url "<https://kotlin.bintray.com/kotlinx>" }
            maven { url "<https://dl.bintray.com/jetbrains/kotlin-native-dependencies>" }
    d
    g
    • 3
    • 6
  • i

    ivan.savytskyi

    04/24/2019, 3:27 PM
    hey folks, after migrating Kotlin to
    1.3.30
    the compilation of ios target fails with this stack trace:
    ...:compileKotlinIos FAILED
    e: Compilation failed: null
    
     * Compiler version info: Konan: 1.2 / Kotlin: 1.3.30
     * Output kind: LIBRARY
    
    e: kotlin.KotlinNullPointerException
            at org.jetbrains.kotlin.backend.common.phaser.PhaseConfig.phaseSetFromConfiguration(PhaseConfig.kt:64)
            at org.jetbrains.kotlin.backend.common.phaser.PhaseConfig.<init>(PhaseConfig.kt:14)
            at org.jetbrains.kotlin.backend.konan.Context.<init>(Context.kt:216)
            at org.jetbrains.kotlin.backend.konan.KonanDriverKt.runTopLevelPhases(KonanDriver.kt:20)
            at org.jetbrains.kotlin.cli.bc.K2Native.doExecute(K2Native.kt:78)
            at org.jetbrains.kotlin.cli.bc.K2Native.doExecute(K2Native.kt:35)
            at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:84)
            at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:42)
            at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:103)
            at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:81)
            at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:49)
            at org.jetbrains.kotlin.cli.common.CLITool$Companion.doMainNoExit(CLITool.kt:214)
            at org.jetbrains.kotlin.cli.common.CLITool$Companion.doMain(CLITool.kt:206)
            at org.jetbrains.kotlin.cli.bc.K2Native$Companion$main$1.invoke(K2Native.kt:217)
            at org.jetbrains.kotlin.cli.bc.K2Native$Companion$main$1.invoke(K2Native.kt:208)
            at org.jetbrains.kotlin.konan.util.UtilKt.profileIf(Util.kt:39)
            at org.jetbrains.kotlin.konan.util.UtilKt.profile(Util.kt:33)
            at org.jetbrains.kotlin.cli.bc.K2Native$Companion.main(K2Native.kt:210)
            at org.jetbrains.kotlin.cli.bc.K2NativeKt.main(K2Native.kt:296)
            at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:16)
    Did anyone see the same issue?
    d
    • 2
    • 10
  • k

    kgonyon

    04/24/2019, 5:53 PM
    I found this example of creating a fat-framework for iOS https://github.com/ilmat192/kotlin-native-gradle-samples/blob/master/fat-framework/build.gradle.kts. Is there anyway to make all iOS targets use the same source set? The way the sample is set up each architecture has a different set of source files.
    d
    • 2
    • 4
  • d

    darkmoon_uk

    04/24/2019, 11:34 PM
    Also; given that shared sourceSet seems to be the new-world approach to multi-platform, isn't the tutorial here: https://kotlinlang.org/docs/tutorials/native/mpp-ios-android.html#creating-the-shared-module ...just plain out-of-date, or a lesser advised alternative, and therefore harmful to adoption? Confusing newcomers (me) is never a good look. I feel like given the change that occurred, they should at least be explicit about it, in a foot-note.
    💯 1
    j
    r
    • 3
    • 12
  • b

    basher

    04/24/2019, 11:52 PM
    Do you have to call
    initRuntimeIfNeeded
    for threads created outside of K/N runtime (e.g. GCD threads on iOS)?
    g
    • 2
    • 1
  • o

    oleksandr.stepanov

    04/25/2019, 9:12 AM
    Hello everyone 👋 I am struggling with next task: I want to build CocoaPods dependencies from sources to be used in Kotlin module. Suppose there is an iOS app project with CocoaPods set up and Pods directory inside with sources to compile frameworks. I want to add
    cinterops
    dependency to the
    build.gradle
    of common module, so it makes Pods accessible for Kotlin code in iOS module, compiles and links with Pods frameworks. This is almost done in https://github.com/RubyLichtenstein/Kotlin-Multiplatform-Firebase repo for Firebase Pod, however they link against pre-compiled framework placed in c_interop/firestore directory. What I need, is to build these frameworks as part of gradle build step and link against them while creating Kotlin framework for iOS. If anybody has succeeded with such task, could you, please, share the sample project? Thanks.
    s
    • 2
    • 11
  • d

    Dmitry Motyl

    04/25/2019, 1:28 PM
    Guys, how can I resolve this problem? What I need to import?
    Unresolved reference: WeakReference
    d
    s
    r
    • 4
    • 21
  • g

    GarouDan

    04/25/2019, 2:42 PM
    Hi, I’ve asked this question in the gradle slack, but it looks like this is more pertinent to this channel. I’m trying to use the
    <https://github.com/johnrengelman/shadow>
    plugin, to create fatJars. I’ve already done the integration in my project but I’m seeing only a
    knows task
    . (I’m using gradle
    5.3.1
    ) My current configuration is:
    import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
    ...
    plugins {
        kotlin("multiplatform")
    
        id("com.github.johnrengelman.shadow") version "5.0.0"
    }
    ...
    tasks.withType<ShadowJar> {
        baseName = "app"
        classifier = ""
        version = ""
    }
    With
    ./gradlew tasks
    I can se only a
    knows
    task
    Shadow tasks
    ------------
    knows - Do you know who knows?
    and if I run
    ./gradlew shadowJar
    I receive an error like:
    * What went wrong:
    Task 'shadowJar' not found in root project 'my_project'.
    Does someone have a working example with a kotlin mpp project and fatJars? It looks like the
    shadowJar
    task is created only in the presence of the
    JavaPlugin
    and because I’m using Kotlin it is not being created. Thanks in advance!
    r
    d
    • 3
    • 9
  • p

    pardom

    04/25/2019, 6:15 PM
    Is there a pod for coroutines? I’m trying to use them in an iOS project with the new cocoapods plugin.
    s
    • 2
    • 1
  • p

    pardom

    04/25/2019, 8:02 PM
    I’m using the new cocoapods plugin to import two mpp projects to an iOS project. Both projects use and export some of the same Kotlin classes. I’m getting this error because of this:
    ld: 46 duplicate symbols for architecture x86_64
    Anyone know how to avoid this?
    k
    k
    • 3
    • 6
Powered by Linen
Title
p

pardom

04/25/2019, 8:02 PM
I’m using the new cocoapods plugin to import two mpp projects to an iOS project. Both projects use and export some of the same Kotlin classes. I’m getting this error because of this:
ld: 46 duplicate symbols for architecture x86_64
Anyone know how to avoid this?
k

Kris Wong

04/25/2019, 8:10 PM
split that out into a shared dependency
k

kpgalligan

04/25/2019, 8:24 PM
One native framework at a time total
p

pardom

04/25/2019, 8:24 PM
Could I export the dependency in
binary { framework { } }
?
k

kpgalligan

04/25/2019, 8:27 PM
Don’t know?
p

pardom

04/25/2019, 8:28 PM
Yep, that seems to work (so far).
Confirmed working.
View count: 3