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
  • k

    Kris Wong

    02/05/2020, 4:33 PM
    it's interesting pulling in dependencies using gradle metadata - sometimes I only need a common dependency, and sometimes that doesn't work
    r
    10 replies · 2 participants
  • k

    Kris Wong

    02/05/2020, 7:50 PM
    anyone know a base 64 implementation besides KorIO
    ☝️ 1
    j
    4 replies · 2 participants
  • k

    Kenneth Andersson

    02/06/2020, 6:14 AM
    Hi all, we are running a kotlin mpp project (which currently targets jvm and js). As part of this, we have a integration test suite that needs to feed a large json file into the code being tested. Currently, we are fetching this over http from somewhere in the cloud, which is far from ideal. We are looking to change this, and tried implemeting file operations for jvm and js targets, but then we ran into problems finding the root path that gradle executes the testcases from, and it just became messy. An alternative would be to start a small http server as part of the gradle build, which would eliminate the cloud dependency. Has anyone done anything similar? Any recommendations?
    j
    k
    22 replies · 3 participants
  • v

    vanniktech

    02/06/2020, 8:15 AM
    Has anyone been able to call a method from a Cocoapods dependency in Kotlin? I’m refering to https://kotlinlang.org/docs/reference/native/cocoapods.html#interoperability
    import cocoapods.AFNetworking
    fails when compiling via Xcode with:
    Packages cannot be imported
    import cocoapods.*
    and referencing
    AFNetworking
    does not seem to work either:
    Unresolved reference: AFNetworking
    a
    3 replies · 2 participants
  • c

    curioustechizen

    02/06/2020, 8:31 AM
    I want to get back to the gradle modules versus sourceSets in a single module discussion. Right now we use gradle modules for 2 reasons: 1. Avoid accidentally dependencies (example, our
    domain
    modules are all pure kotlin modules so they cannot inadvertently depend on Android classes) 2. Build performance (only recompile modules that need to) Looks like 1. can be achieved with sourceSets because you can declare dependencies for each sourceSet independently. It will require a bit of discipline because the gradle module might be for example
    com.android.library
    but it is doable. Are there any docs about build performance with sourceSets that I should be aware of?
    k
    3 replies · 2 participants
  • a

    Andreas Jost

    02/06/2020, 9:22 AM
    The Task :app:compileDebugUnitTestKotlinAndroid of my MPP throws this error:
    Quotes\app\src\commonTest\kotlin\de\ajo\quotes\SampleTests.kt: (3, 20): Unresolved reference: Test
    It's that line:
    import kotlin.test.Test
    And then the same error with assertTrue But in app's build.gradle:
    commonTest {
        dependencies {
            implementation kotlin('test-common')
            implementation kotlin('test-annotations-common')
        }
    }
    Why is that? Also the following tasks run without errors: :app:compileTestKotlinJs, app:jsTest, :app:jvmTest, :app:allTests, etc. and IntelliJ doesn't mark these lines as unresolved.
    k
    i
    11 replies · 3 participants
  • g

    galex

    02/06/2020, 11:17 AM
    Hello, how hard would it be to create my own custom target to build a kmp as a PHP Extension (through C) ?
    🤣 3
    ❤️ 1
    🙈 2
    🤮 3
    🍰 2
    l
    2 replies · 2 participants
  • t

    tarek

    02/06/2020, 3:31 PM
    Is there a way to disable running common tests on one specific target ?
    k
    4 replies · 2 participants
  • a

    addamsson

    02/06/2020, 7:46 PM
    Is there someone here who publishes MPP projects using the Gradle Kotlin DSL to Maven Central?
    i
    c
    +1
    64 replies · 4 participants
  • e

    Eivind Nilsbakken

    02/07/2020, 7:41 AM
    What is the status on using multiplatform to publish npm modules? I read https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#publishing-a-multiplatform-library, but that didn't make me any wiser. I've read https://medium.com/swlh/kotlin-to-jar-and-npm-87a5b0ca2dff, which has a solution, but that feels like a bit of a hack. Also, publishing maven artifacts with Javadoc seems to have become easier since that was written.
    s
    g
    9 replies · 3 participants
  • l

    Liliia

    02/07/2020, 11:50 AM
    Hi everybody! It’s the Kotlin Mobile Multiplatform team here.  It would be impossible for us to make effective ecosystem improvements without feedback from our users. We’d like to hear more about your specific experience in mobile multiplatform (iOS + Android) development. We’re particularly keen to find out which libraries you need most while building an app. Please, let us know by taking this survey: https://surveys.jetbrains.com/s3/kotlin-mobile-multiplatform-libraries-survey-slack.  The survey is short, but the answers may take some thinking about. :)  And, as a reward, at the end of the survey we’ll give you a list of all the mobile multiplatform libraries that we discovered while putting the survey together. You could also win a free 1-year All Products Pack subscription. Enjoy! And please don’t forget to share this with your friends and colleagues!
    🔥 8
    👍 4
    j
    r
    +1
    10 replies · 4 participants
  • d

    dimsuz

    02/07/2020, 1:02 PM
    Heh, I opened this chat to ask if there's a proper DI library for KMP which is not a Service Locator implementation, and here is the survey about missing libraries. Still. Is there a non-SL DI library available for KMP?
    k
    k
    28 replies · 3 participants
  • p

    pajatopmr

    02/07/2020, 4:40 PM
    I'm just beginning to develop a KMP library for ios (framework) that depends on a KMP library (jvm and native). Seems to me like I have to wrestle with nested frameworks so I'm looking for references to existing solutions and discussions.
    a
    1 reply · 2 participants
  • s

    Samuel Michael

    02/08/2020, 11:16 PM
    tried to use the default ios.android kotlin multiplatform starter from intellij and getting a non-zero exit code
    l
    7 replies · 2 participants
  • n

    Nick Halase

    02/10/2020, 12:57 AM
    anyone know of a good way to check if a String contains ONLY ASCII characters in an
    ios
    target
    actual
    ?
    i
    4 replies · 2 participants
  • r

    Ryan Simon

    02/10/2020, 2:43 AM
    I’m starting to dive deeper into KMP, and I’m wondering how some of you are setting up your development environments? I’m mainly an Android dev, so for iOS code I’m assuming I should just be using Xcode? Or is there a better way to bridge the two? I’ve seen that Jetbrains has AppCode with Kotlin Native support. Is that a better fit for KMP projects?
    d
    s
    8 replies · 3 participants
  • k

    Kirill Shmakov [JB]

    02/10/2020, 7:35 AM
    Dear community, starting from the last Kotlin plugin EAP (
    1.3.70-eap-184
    ) there is no more need for special breakpoints for native debug (see https://kotlinlang.slack.com/archives/C3PQML5NU/p1564747546241900). Now same breakpoints work both for JVM and Native debugging in MPP. Feel free to share your feedback.
    🔥 6
    1 reply · 1 participant
  • m

    matej

    02/10/2020, 3:47 PM
    Am I imagining things, or are there currently no libraries for XML parsing / serialization in kotlin-native?
    k
    k
    +3
    11 replies · 6 participants
  • k

    Kris Wong

    02/10/2020, 9:13 PM
    hmmm, looks like getting sqldelight w/ encryption is going to be a challenge for K/N. anyone tried this?
    b
    k
    25 replies · 3 participants
  • g

    Gavin Ray

    02/10/2020, 9:25 PM
    This may well be a stupid question, but is there any chance in the future that Kotlin might target crossplatform native mobile apps in their entirety? Essentially something like React Native/NativeScript/Flutter? I had largely dismissed Java and the JVM for my entire career because of enterprise + massive bloat, but Kotlin has made me want to give it a shot. Especially with libraries like Arrow. It seem as though you can write incredibly clean multi-paradigm code and leverage all of the existing tooling and libraries for Java & the JVM. Essentially, something on the order of a better Typescript from the looks of it. My only hangup is that I have a hard time justifying picking up Kotlin and the JVM, when I am able to write Frontend + Backend + Cross-platform mobile apps in entirely Typescript. And then the hiring + talent-finding process becomes more difficult because I have to hire JS/TS devs and Java/Kotlin devs.
    👍 1
    n
    d
    +6
    63 replies · 9 participants
  • f

    fcosta

    02/11/2020, 1:35 AM
    Hi! I created a appleMain source set in my build.gradle to share common code between Apple platforms for instance iOS and WatchOS. However, it seems Intellij was unable to find the imports and now i can't autocomplete code anymore. 😞 Any idea how i can make this work again? Here is my build.gradle file: https://github.com/felipehjcosta/chat-app/blob/master/common/client/build.gradle
    k
    l
    10 replies · 3 participants
  • b

    basher

    02/11/2020, 5:13 AM
    Started a GitHub template repository for bootstrapping a working mobile shared library project: https://github.com/benasher44/KotlinMobileBootstrap Not sure if something like this exists already outside of the IDEA new project template? Plan to start filling it up with examples of some of the trickier ios mpp build things I've dealt with over time (right now, just a working iOS & JVM). Working on a few things at the moment though, so it might be a bit until there are more updates. contributions welcome 🙂
    👍 4
    o
    r
    8 replies · 3 participants
  • p

    Patrick

    02/11/2020, 9:06 AM
    I'm trying to use Ktor on native (MacOS, Windows 10) using curl.
    val client = HttpClient(Curl) {
        install(JsonFeature) {
            serializer = KotlinxSerializer()
        }
    }
    
    val response = client.get<String>("<https://google.com>")
    
    println(response)
    This code works fine on MacOS, but fails on windows with this error message:
    Uncaught Kotlin exception: io.ktor.client.engine.curl.CurlIllegalStateException: Connection failed for request: CurlRequestData(url='<https://google.com/>', method='GET', content: 0 bytes)
            at kfun:kotlin.Throwable.<init>(kotlin.String?;kotlin.Throwable?)kotlin.Throwable (000000000045bbc0)
            at kfun:kotlin.Throwable.<init>(kotlin.String?)kotlin.Throwable (000000000045beb0)
            at kfun:kotlin.Exception.<init>(kotlin.String?)kotlin.Exception (0000000000455160)
            at kfun:kotlin.RuntimeException.<init>(kotlin.String?)kotlin.RuntimeException (0000000000454ca0)
            at kfun:kotlin.IllegalStateException.<init>(kotlin.String?)kotlin.IllegalStateException (0000000000455330)
            at kfun:io.ktor.client.engine.curl.CurlIllegalStateException.<init>(kotlin.String)io.ktor.client.engine.curl.CurlIllegalStateException (00000000006d72d0)
            at kfun:io.ktor.client.engine.curl.internal.CurlMultiApiHandler.readResponseDataFromEasyHandle#internal (00000000006ded80)
            at kfun:io.ktor.client.engine.curl.internal.CurlMultiApiHandler.collectCompleted#internal (00000000006de290)
            at kfun:io.ktor.client.engine.curl.internal.CurlMultiApiHandler.pollCompleted(<http://kotlin.Int|kotlin.Int>)kotlin.collections.List<io.ktor.client.engine.curl.internal.CurlResponseData> (00000000006dd400)
            at kfun:io.ktor.client.engine.curl.pollCompleted$ktor-client-curl()kotlin.collections.List<io.ktor.client.engine.curl.internal.CurlResponseData> (00000000006d9cc0)
            at kfun:io.ktor.client.engine.curl.CurlProcessor.poll$lambda-6#internal (00000000006d94f0)
            at _ZN6Worker19processQueueElementEb (00000000008900c0)
            at _ZN12_GLOBAL__N_113workerRoutineEPv (00000000008915e0)
            at pthread_create_wrapper (00000000008c1850)
            at  (00007ffdcfd2b02c)
            at  (00007ffdcfd2b0a0)
            at  (00007ffdd04c7bc0)
            at  (00007ffdd0f0ceb0)
    Does anyone have an idea why this does not work?
    m
    9 replies · 2 participants
  • m

    matej

    02/11/2020, 12:56 PM
    How do you guys unit test suspending functions in KMP, when
    org.jetbrains.kotlinx:kotlinx-coroutines-test
    is not available for common code?
    k
    4 replies · 2 participants
  • s

    Sylvain Patenaude

    02/11/2020, 2:53 PM
    Why do I have some "*-GBYM_sE*" suffixes added to some of my methods in the .jar file generated for target "jvm"? When I try to call my Kotlin MP library from Java, I see the suffix-added names. 🤔
    d
    10 replies · 2 participants
  • k

    Kris Wong

    02/11/2020, 4:59 PM
    anyone aware of a multiplatform way to execute some work after a delay (in order to coalesce multiple requests)?
    a
    7 replies · 2 participants
  • k

    Kris Wong

    02/11/2020, 8:17 PM
    does anyone know if you need 1 database per thread when using SQL Delight on native?
    a
    k
    +1
    10 replies · 4 participants
  • s

    Shan

    02/12/2020, 12:40 AM
    When trying to publish a JS artifact to a maven repository I am getting this error:
    file or directory '/builds/my/org/my-project/src/jsMain/kotlin' not found
    and I cannot see to figure out why.. Anyone have any ideas? 🤔
    Untitled
    r
    e
    5 replies · 3 participants
  • j

    Julius Hannink

    02/12/2020, 12:46 PM
    Hi everyone, I was wondering if it was possible to access kotlin code from a python environment without too much overhead in wrapping the stuff from the python side?! The application I am considering is an algorithm library in kotlin used in production for android / desktop / potentially iOS that our partners and us also want to use in research contexts where python is the weapon of choice. I saw this https://github.com/JetBrains/kotlin-native/tree/master/samples/python_extension but the wrapping stuff on the c-side seems too much overhead for now...Any thoughts?
    k
    p
    3 replies · 3 participants
  • s

    Sylvain Patenaude

    02/12/2020, 2:39 PM
    Currently, the .jar generated for my jvm target doesn't include the Kotlin dependencies. Is there a way to create some kind of archive (.ar) that would include those dependencies?
    k
    3 replies · 2 participants
Powered by Linen
Title
s

Sylvain Patenaude

02/12/2020, 2:39 PM
Currently, the .jar generated for my jvm target doesn't include the Kotlin dependencies. Is there a way to create some kind of archive (.ar) that would include those dependencies?
k

Kris Wong

02/12/2020, 2:43 PM
i use the shadow jar plugin for this
s

Sylvain Patenaude

02/12/2020, 2:58 PM
Thanks, I'll look into it. Any link or reference?
k

Kris Wong

02/12/2020, 3:00 PM
google shadow jar plugin
👍 1
View count: 4