https://kotlinlang.org logo
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

    Konstantin Petrukhnov

    10/21/2019, 8:16 AM
    E.g. how to read File, with provided filepath
    g
    j
    • 3
    • 2
  • f

    fcosta

    10/21/2019, 2:18 PM
    I'm trying to add SwiftUI to my sample project but i can't use
    Preview
    . It crashes. Any way to workaround this? The log follows:
    xcode_preview_crash.txt
    k
    a
    • 3
    • 14
  • s

    Sujit

    10/21/2019, 7:43 PM
    I've a bit of confusion with KMP build for native. I'm trying to build for iOS platforms, both sim and device (only 64 bits). So, I've it build as follows:
    val ios64 = iosArm64("ios64")
        val iosSim = iosX64("iosSim")
        val iosMain by sourceSets.creating {
            dependencies {
                implementation(kotlin(Config.ios.dependencies.stdlib))
                implementation(Config.ios.dependencies.serialization)
                implementation(Config.ios.dependencies.coroutines)
            }
        }
        val iosTest by sourceSets.creating {
            dependencies {
                implementation(kotlin(Config.ios.dependencies.stdlib))
                implementation(Config.android.dependencies.coroutinesTest)
            }
        }
        configure(listOf(ios64, iosSim)) {
            binaries.framework {
                baseName = Config.ios.frameworkName
                freeCompilerArgs.add("-Xobjc-generics")
            }
            sourceSets {
                @Suppress("UNUSED_VARIABLE")
                val ios64Main by getting {
                    dependsOn(iosMain)
                }
                @Suppress("UNUSED_VARIABLE")
                val iosSimMain by getting {
                    dependsOn(iosMain)
                }
                @Suppress("UNUSED_VARIABLE")
                val ios64Test by getting {
                    dependsOn(iosTest)
                }
                @Suppress("UNUSED_VARIABLE")
                val iosSimTest by getting {
                    dependsOn(iosTest)
                }
            }
        }
    Now, when I make a publication, it publishes two separate native components for iOS, basically, for both
    iossim
    , and
    ios64
    . What's the standard way to do this, such that I can only publish the native library called
    native
    , and no
    iossim
    ,
    ios64
    . I feel like I'm missing a link here somewhere... All the sources are in
    iosMain
    , and
    iosTest
    folders
    k
    r
    • 3
    • 16
  • h

    hhariri

    10/22/2019, 9:39 AM
    Package Search is something we've been working on that provides amongst others things, discoverability of multiplatform packages. https://blog.jetbrains.com/idea/2019/10/introducing-package-search-eap/
    🤔 3
    👍 6
    ❤️ 14
    f
    a
    j
    • 4
    • 17
  • k

    Kenneth Andersson

    10/22/2019, 4:16 PM
    Hi all, Im working on a larger project utilizing kotlin multiplatform. We have recently started an upgrade from the older plugins to the kotlin.multiplatform plugin, but we have run into a bit of a problem. Im hoping someone here can shed some light on what we are doing wrong. The problem is essentiallly that we would like to run the testcases on all our target platforms, and we have it running on all targets, except js, which sadly is the most important atm. I created a sample repository that demonstrates the problem: https://github.com/jayway/kotlin-multiplatform-js-tests-debug If you build that repository, you get an error when it tries to run the common testcases in js (it works in jvm). Does anybody have a solution? Thanks!
    b
    i
    • 3
    • 7
  • f

    FranGSierra

    10/23/2019, 8:20 AM
    Hello, there is any way to change the name of the headers of the binaries generated for iOS project? if my
    sharedModule
    class is
    Storage
    on iOS it's generated and called as
    StorageKT
    . There is any way to change the name programatically?
    a
    • 2
    • 4
  • z

    Zhan Huang

    10/23/2019, 5:57 PM
    I'm trying to create a shared interface for iOS and Android in kotlin multiplatform, and have this function that takes in a url. Is there a way I can make the iOS function take NSURL, but the android one take java.net.Url? Or should I just stick to String?
    k
    • 2
    • 3
  • s

    Sylvain Patenaude

    10/23/2019, 8:10 PM
    I often get confused in Kotlin MP with the notions of projects, modules, directories, especially the module one. In the context of my SDK (for Android, iOS consumers), I have a single project, but when it's time to partition the code (1-cross platform, 2-native Android, 3-native iOS), is it preferable to have 3 modules for that or 3 folders would do the job? I suspect that 3 modules are better, but not 100% sure. (The end goal is to have 2 build pipelines generating respectively .jar/.framework files.) Edit: Basically, the more general questio around that is, in the context of a Kotlin Multiplatform project, do you always structure your code/build files by modules (1 shared, 1 for each target) or do you sometimes separate with plain/regular directories? Edit 2: On 2nd thought, I think the project/module/directory nomenclature may be closer to the IDE I use (IntelliJ) than the Kotlin language itself.
    k
    • 2
    • 5
  • d

    Dmitri Sh

    10/24/2019, 1:17 AM
    eposting from the general channel, as no answers there- maybe better luck here - this channel looks to be the most appropriate one? A multiplatform project, android and iOS. In common code in Kotlin, I have an interface -
    interface Idea
    . When in Swift, want to have a struct implement this interface, a.k.a protocol now in the Swiftland. Get a compiler error -
    inheritance from non-protocol type 'Idea'.
    In the generated objective-c file I see this -
    __attribute__((objc_subclassing_restricted))
    . Reading on it, all objective c protocols are restricted to classes. So how I do get around this problem - or no getting around and have to use classes in Swift😥?
    a
    k
    • 3
    • 4
  • a

    Alexander Minyaev

    10/24/2019, 4:33 PM
    https://kotlinlang.slack.com/archives/C8NEU7N9L/p1571934719000700 #dsl
    a
    g
    • 3
    • 5
  • k

    Kris Wong

    10/24/2019, 8:23 PM
    weird configuration error
    Untitled
    • 1
    • 1
  • k

    Kris Wong

    10/24/2019, 9:02 PM
    hot damn I got an MPP setup with kotlin DSL and Android
    😆 1
    p
    r
    • 3
    • 7
  • k

    kpgalligan

    10/25/2019, 12:44 AM
    SwiftUI? Very low, for technical reasons. Compose for iOS would be more feasible, but it’ll be a while, and clearly not trivial
    j
    m
    +2
    • 5
    • 9
  • m

    Marc Reichelt

    10/25/2019, 11:38 AM
    Hi there! I activated Kotlin Native / Multiplatform in our Android project using the tutorial on https://play.kotlinlang.org/hands-on/Targeting%20iOS%20and%20Android%20with%20Kotlin%20Multiplatform/ - and I get an error on our CI server when trying to run the gradle task `app:lintVitalRelease`:
    > Task :app:prepareLintJar
    > Task :app:lintVitalRelease FAILED
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':app:lintVitalRelease'.
    > Configuration with name 'compileClasspath' not found.
    a
    r
    • 3
    • 8
  • s

    Sylvain Patenaude

    10/25/2019, 7:05 PM
    message has been deleted
    k
    • 2
    • 3
  • k

    kpgalligan

    10/26/2019, 4:20 PM
    Giving a talk on Multiplatform library development. Looking for thoughts on what libraries/tools developers think are critical and missing. Just comments in a thread for now I guess (or DM).
    c
    i
    +8
    • 11
    • 46
  • s

    Shan

    10/26/2019, 11:47 PM
    Hey all. Trying to set up a new multiplatform project and was reading about the
    enableFeaturePreview("GRADLE_METADATA")
    feature. Is the idea that I apply a
    common
    dependency to my commonMain and if I have this enabled it will auto apply the correct dependency for each target's sourceset, as long as they have supported the metadata feature also?
    ➕ 2
    k
    • 2
    • 1
  • s

    Shan

    10/26/2019, 11:52 PM
    Another separate question, is there a way to target all Native targets and not list each individually?
    o
    • 2
    • 2
  • l

    louiscad

    10/27/2019, 9:32 AM
    @h0tk3y I've had a reaaaaaly bad time with that combination: MPP + Android testing. It runs `androidTest`s as unit tests, which is something I don't want because these are actually non Android JVM and my code relies on Android runtime. I've tried to understand how MPP works with AGP, but failed to do so, and invested so much time to only get hacky workarounds, and they are not even sufficient. I ignored these issues for a long time but I want to automate the building, testing and publishing of my (open source) project with GitHub Actions, and these issues are becoming a true nightmare. I hate Android-less "unit test" so much now, and I still didn't figure out how to escape it when using MPP and having common tests and tests in
    androidTest
    (which maps to AGP
    test
    is seems, but I sadly don't know how). I'm mentioning you because I know you worked on AGP integration, and I digged so deep without a real solution that I don't know who else could help me on that one.
    k
    a
    +2
    • 5
    • 30
  • k

    Konstantin Petrukhnov

    10/28/2019, 8:11 AM
    Is there example how to refer api dependency(native, metadata) on local FS? I have kotlin mpp lib, that is build but not published to repo. I want to have it as dependency from other kotlin mpp project.
    f
    • 2
    • 2
  • m

    Marc Reichelt

    10/28/2019, 1:40 PM
    Does anyone have an issue finding the iosMain source set? I added the following code to my `build.gradle.kts`:
    sourceSets["iosMain"].dependencies {
            implementation("io.ktor:ktor-client-ios:$ktorVersion")
        }
    But Gradle complains with “KotlinSourceSet with name ‘iosMain’ not found.“…
    a
    s
    r
    • 4
    • 17
  • s

    Sylvain Patenaude

    10/28/2019, 3:37 PM
    When trying to build my Kotlin MP project on a MacOS build agent (Azure), I see the following log in the build window:
    Project MySDK at : is either no Android app project or build version has not been set to override. Skipping...
    Therefore, no .framework file is generated. Any clue?
    • 1
    • 2
  • j

    JoakimForslund

    10/29/2019, 9:27 AM
    Is there any way from code to detect what architecture the code is running under with multiplatform common? (I.e x32 or x64) Or do I need to lift this out to be detected under each platform?
    y
    • 2
    • 2
  • e

    Erik Christensen

    10/29/2019, 7:23 PM
    Hey everyone! So I've been working on a multiplatform date-time library called Island Time. It's a "from scratch" Kotlin library that draws heavily from java.time (since they got a lot right). It's still early in development, but here's a run down on some of the features that are already in place: - Support for JVM, Android, iOS, and macOS - Full timezone support on each platform - Date-time primitives like Instant, Date, Time, DateTime, ZonedDateTime, and so forth - Reading and writing to ISO representations - A DSL for defining custom parsers - Integration with Kotlin ranges and progressions Probably the biggest absent feature right now is support for custom and localized formatting. In preparation for an initial release, I'm very interested in getting any and all feedback to help flush out the API, find all the warts, and prioritize issues and features. If you have any ideas on how to make a better time library or you'd like to collaborate, please let me know. Development snapshot builds are available if you want to want to try it out. You can find more information on the GitHub page: https://github.com/erikc5000/island-time . I've started filing design-related issues there to provide a forum for discussion on specific parts of the library's design in effort to start opening it up more.
    🎉 10
    k
    t
    +3
    • 6
    • 21
  • k

    Konstantin Petrukhnov

    10/30/2019, 5:17 AM
    What are the current options for not implementing twice actual for ios arm/x64? I know it was mentioned multiple times in conversations during last few month. It is hard to dig through search and comments in slack.
    a
    m
    +3
    • 6
    • 26
  • r

    Rishabh Harit

    10/30/2019, 12:11 PM
    Can someone tell me how can we add platform specific secondary constructors to a class?
    s
    • 2
    • 1
  • m

    magnumrocha

    10/30/2019, 1:13 PM
    some weeks ago I posted this question on Kotlin Discusss: https://discuss.kotlinlang.org/t/kotlin-multiplatform-binaries-name-for-native-targets/14364
    a
    • 2
    • 2
  • t

    Tony

    10/30/2019, 6:04 PM
    Can suspend methods on Kotlin Multiplatform be accessed by iOS or Android?
    k
    s
    • 3
    • 20
  • k

    Kurt Renzo Acosta

    10/31/2019, 12:38 AM
    Has anyone made a modularized project with multiplatform for iOS? Saw this article (https://medium.com/web-factory-llc/modularize-your-kotlin-multiplatform-project-6e5831508a81) where you create a "bridge" module just to tie up all the other modules but it's not a plug-and-play solution as you have to expose the objects/classes in the bridge module so you can use them in K/N
    d
    g
    +2
    • 5
    • 15
  • k

    Konstantin Petrukhnov

    10/31/2019, 6:14 AM
    Any ETA for 1.3.60? it says October 2019 in changelog
    g
    t
    d
    • 4
    • 5
Powered by Linen
Title
k

Konstantin Petrukhnov

10/31/2019, 6:14 AM
Any ETA for 1.3.60? it says October 2019 in changelog
g

gildor

10/31/2019, 6:27 AM
As usual no official ETA
But you can estimate yourself. Usually it has 2 weeks between EAPs
and 1-4 EAPs before release (also usually in 2 weeks + a couple days for deploy)
t

tylerwilson

10/31/2019, 2:28 PM
I am excited. The changelog for Native looks pretty nice…
👍 1
d

darkmoon_uk

11/07/2019, 12:16 AM
Does too 🙂 https://github.com/JetBrains/kotlin-native/blob/master/CHANGELOG.md
View count: 6