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

    hmole

    08/13/2018, 2:31 PM
    How to properly declare a dependency on pure(no platform modules)
    common-module1
    jar in another
    common-module2
    ? So far i'm getting NoClassDefFound in my 'common-module2-jvm', but IDE doesn't highlight imports as red and allows to navigate to them(
    common-module1
    ).
    r
    • 2
    • 9
  • a

    ankushg

    08/13/2018, 9:32 PM
    IntelliJ/Android Studio seems to be having issues with types defined as `expect`/`actual`... My setup has my KMPP being pulled into my Android project via
    includeBuild
    , and then the IDE complains with stuff like
    Wrong nth argument type. Found: 'Foo', required: 'Foo'
    (where the method using
    Foo
    is in my common code, but
    Foo
    is defined in my JVM code via `expect`/`actual`)
    l
    • 2
    • 1
  • h

    hmole

    08/15/2018, 7:48 AM
    Is this my correct understanding of how can you make multiple modules with just common code that depend on each other?
    😂 4
    i
    l
    • 3
    • 3
  • g

    gregopet

    08/17/2018, 12:06 PM
    Now I'm making a call using
    client.call {
                url("<https://192.168.2.233:4040/jokes/random>")
                method = HttpMethod.Get
            }
    and it never completes - I should probably wait until it's out of alpha, right? 🙂
    a
    • 2
    • 6
  • h

    hmole

    08/20/2018, 3:24 PM
    Is there working example of producing .framework file for IOS out of empty native module(only common code)?
    r
    • 2
    • 1
  • k

    kpgalligan

    08/20/2018, 6:36 PM
    Droidcon NYC app published to iOS app store! https://medium.com/@kpgalligan/kotlin-multiplatform-in-the-app-store-c3a50c24f93b
    👏 8
    🐶 1
    a
    l
    +2
    • 5
    • 10
  • a

    ankushg

    08/23/2018, 5:45 PM
    Silly questions somewhat related to KMPP: if I'm pulling in a KMPP build into an Android project using Composite Builds (
    includeBuild
    ), is there a simple way to ignore all the ios/native/js platform modules? I only care about common/jvm/android ones, and there's a ton of irrelevant stuff taking up sidebar space in this project now 😞 Also, is it normal that
    includeBuild
    doesn't maintain the nesting of modules? I had the platform modules nested under the common ones in my KMPP, and now they've all been flattened 😞
    t
    • 2
    • 3
  • k

    kpgalligan

    08/27/2018, 7:57 PM
    https://medium.com/square-corner-blog/okio-2-6f6c35149525?source=linkShare-c2f810aa7890-1535399266
    :kotlin: 5
    👌 2
    🔲 7
    m
    t
    +2
    • 5
    • 10
  • h

    hmole

    08/29/2018, 10:18 AM
    Can I compile kotlin-multiplatform-native on widnows into a .framework file? I opened this project https://github.com/JetBrains/kotlin-mpp-example in my Windows IntellijIdea and tried to do so, but there is no
    compileDebugIos_x64KotlinNative
    task that is referenced in this gradle script https://github.com/JetBrains/kotlin-mpp-example/blob/master/greeting/ios/build.gradle. I'm not familiar with how ios build system works, do I need to open it from Xcode on Mac?
    s
    • 2
    • 3
  • a

    ankushg

    08/29/2018, 6:34 PM
    Hey friends! Does anyone know how IntelliJ/Android Studio is supposed to work when using Multiplatform projects as a Composite Build? The IDE is giving me a lot of errors with
    actual
    definitions saying that there's no corresponding `expect`ed declaration
    r
    • 2
    • 4
  • j

    juliocbcotta

    08/30/2018, 6:22 AM
    Is there any effort/project to offer a common
    Locale
    class ?
    a
    • 2
    • 1
  • t

    tulio

    08/31/2018, 8:55 AM
    Hello guys, I’m trying to share some code between Android and iOS apps and my final goal is to have a completely detached kotlin project in a different repository that could generate a
    jar
    for android and a
    framework
    for iOS. Is there a way to do that currently with kotlin multiplatform/native? (the sample projects are all very coupled)
    ➕ 2
    h
    a
    a
    • 4
    • 10
  • r

    russhwolf

    09/04/2018, 2:46 AM
    Is there an example anywhere of how to run native tests on the ios simulator with the new multiplatform gradle plugin?
    t
    • 2
    • 2
  • r

    r4zzz4k

    09/05/2018, 2:03 PM
    I'm trying to use
    org.jetbrains.kotlin.multiplatform
    and stumbling upon the following issue. Quoting sample repo:
    A project dependency on another MPP project has the same semantics and is also resolved in a variant-aware way:
    ```
    dependencies { implementation project(':my-mpp-lib') }
    So I have `settings.gradle` mentioning
    include(":a") include(":b")
    Then in `a/build.gradle`:
    plugins { id("org.jetbrains.kotlin.multiplatform") } kotlin { targets { fromPreset(presets.linuxX64, 'native') } ... }
    and in `b/build.gradle`:
    plugins { id("org.jetbrains.kotlin.multiplatform") } kotlin { targets { fromPreset(presets.linuxX64, 'native') } sourceSets { commonMain { dependencies { ... implementation project(':a') } } } }
    When I try to run `./gradlew :b:compileKotlinNative`, I get the following error:
    exception: java.lang.IllegalStateException: Could not find "a" in [$PROJ_DIR, $PROJ_DIR/a/build/classes/kotlin/native/main, $HOME/.konan/klib, $HOME/.konan/kotlin-native-linux-0.8.2/klib/common, $HOME/.konan/kotlin-native-linux-0.8.2/klib/platform/linux_x64]. ``` Looking into
    $PROJ_DIR/a/build/classes/kotlin/native/main
    I see a file named
    a-native.klib
    . So the question is, how can I make this work? Do I have to somehow override suffix of
    klib
    or dependency, or is it a bug and the plugin should do this itself?
    • 1
    • 1
  • o

    olonho

    09/05/2018, 5:09 PM
    FYI https://github.com/JetBrains/kotlin-mpp-example was updated to be able to build both iOS and Android application (although without MPP Gradle plugin yet)
    🎉 5
    a
    • 2
    • 3
  • n

    napperley

    09/07/2018, 3:18 AM
    Are JB planning to migrate the "back-end" part of the Kotlin Web IDE (project) from Java to Kotlin, and refactor the project to use the Kotlin multi-platform system (turn the project into a web stack with both the front-end and back-end written in Kotlin with shared business logic)?
    v
    • 2
    • 1
  • h

    hmole

    09/08/2018, 9:15 AM
    Does
    filterIsInstance
    declared in common module works on interface type in js and/or native code?
    o
    • 2
    • 1
  • y

    yousuf.haque

    09/10/2018, 12:21 AM
    @egorand I’m assuming you weren’t able to use dagger for the cross platform stuff, right?
    g
    e
    t
    • 4
    • 3
  • n

    Nikky

    09/11/2018, 4:24 PM
    i tried to add a multiplatform module to a set of existing ones on ktor-client-json this happens: https://asciinema.org/a/OrWy9wtmxzEAxfsSiVSCf0c45 all those lines of errors are just fine according to idea code is here: https://github.com/NikkyAI/ktor/tree/kotlinx-serialization-module/ktor-client/ktor-client-features/ktor-client-json/ktor-client-kotlinx-serialization i suspect this might be a multiplatform bug ? this contains jsut a single expected / actual and it seems like the compiler freaks out and errors on every single statement in one module
    e
    • 2
    • 1
  • s

    spierce7

    09/12/2018, 3:31 PM
    Is there an example of how I release a common mpp lib to maven?
    c
    • 2
    • 2
  • k

    kpgalligan

    09/12/2018, 10:26 PM
    https://twitter.com/kpgalligan/status/1040002731031842816
    👍 3
    🆒 2
    • 1
    • 1
  • r

    r4zzz4k

    09/14/2018, 12:56 PM
    Does
    org.jetbrains.kotlin.multiplatform
    support some way of globally passing
    -Xuse-experimental=kotlin.Experimental
    to compiler?
    h
    • 2
    • 2
  • a

    amorenew

    09/17/2018, 5:24 AM
    KN do business logic code, But is there any effort for KN UI libraries even it is just very basic like a button?
    m
    • 2
    • 2
  • r

    r4zzz4k

    09/17/2018, 11:41 AM
    One more question on `org.jetbrains.kotlin.multiplatform`: Do I understand correctly that
    *Test
    source sets have some specific kind of dependency on
    *Main
    , not simple
    dependsOn
    ? I'm trying to add
    testFixtures
    source set as follows:
    commonMain { ... }
    commonTestFixtures { dependsOn commonMain }
    commonTest { dependsOn commonTestFixtures }
    
    nativeMain { ... }
    nativeTestFixtures { dependsOn nativeMain }
    nativeTest { dependsOn nativeTestFixtures }
    I'm getting internal compiler errors, and after commenting out types mentioned in them just for the sake of moving forward on build process, I got the following from linker:
    llvm-lto: error: Linking globals named 'ktype:org.sample.InterfaceName': symbol multiply defined!
    Apart from the error itself compiler reports source file names, where I clearly see duplications -- but I'm not sure if they are from common / platform modules or duplicated platform module. I guess I'm doing this wrong, but I'm not sure how to redo it properly --
    testFixtures
    definitely needs access to
    main
    as it is based on some types from there, and the sole purpose of it is to provide utilities for
    test
    source set.
    h
    • 2
    • 2
  • s

    spierce7

    09/17/2018, 2:53 PM
    With Kotlin 1.3 I'm seeing the following error with mpp:
    The Feature "multi platform projects" is experimental and should be enabled explicitly
    . How do I enable multi platform projects explicitly in the gradle file? The IDE is of no use here.
    a
    l
    • 3
    • 9
  • j

    jw

    09/18/2018, 3:13 PM
    can I have multiple targets in the new MPP plugin share a source folder for their actuals? most specifically, a bunch of native variants
    n
    l
    • 3
    • 6
  • g

    gvoltr

    09/19/2018, 9:31 AM
    Hello everyone! I want to do a research about code sharing with kotlin between android/IOS for my company. If my goal is sharing all the code, except UI and platform dependent stuff but including DB and networking, should I look into kotlin-native or multiplatform? Is there any projects on github with something similar?
    o
    g
    +2
    • 5
    • 11
  • k

    kpgalligan

    09/19/2018, 2:34 PM
    Working through the new gradle plugin and trying to apply it to a project. I haven't reached the part where I try to get the framework to function, but I'll be there soon. Any examples of multiplatform with the new gradle plugin and an iOS app?
    j
    l
    +2
    • 5
    • 24
  • j

    jw

    09/20/2018, 2:44 AM
    can i specify a
    project()
    dependency from an old platform module to a new multiplatform and select which variant I want it to resolve? this will allow me to incrementally migrate rather than doing everything at once.
    h
    • 2
    • 2
  • k

    kpgalligan

    09/20/2018, 4:57 PM
    Trying to build and publish a library with the new mpp. I can get jvm6/8 and native ios builds to both compile and publish (seems correct but haven't tried to consume). Android library (aar) will build and the aar files wind up in the build folder's outputs section. When published, it'll create a folder for the android lib, but the aar isn't included. The other folders look different (they have jar and klib files). Thoughts? I can push the source later to take a look at it if that helps, but hoping there's a simpler answer (like "do this" or "that doesn't work yet").
    l
    • 2
    • 10
Powered by Linen
Title
k

kpgalligan

09/20/2018, 4:57 PM
Trying to build and publish a library with the new mpp. I can get jvm6/8 and native ios builds to both compile and publish (seems correct but haven't tried to consume). Android library (aar) will build and the aar files wind up in the build folder's outputs section. When published, it'll create a folder for the android lib, but the aar isn't included. The other folders look different (they have jar and klib files). Thoughts? I can push the source later to take a look at it if that helps, but hoping there's a simpler answer (like "do this" or "that doesn't work yet").
I've tried to build the lib sample (https://github.com/h0tk3y/k-new-mpp-samples/tree/master/android-lib-and-app-with-mpp), but the build fails. Wondering if there's something subtle I'm missing before going down that particular rabbit hole.
Kotlin gradle plugin version is '1.3.0-dev-496'
OK, pushed. This is the Timber fork. Ignore most of the folders. The only project that gets built is the 'timber' folder. https://github.com/touchlab/timber/tree/newgradle
I made that config slightly less confusing. To try this out, clone that branch, run gradle build and publish. There's a property called 'localMavenDeploy' that I would normally configure externally, but put in gradle.properties for simplicity here.
l

Liliia

09/21/2018, 10:53 AM
Regarding to `aar`: unfortunately the publishing isn’t implemented yet, but it’s on the way. Most probably, it wouldn’t be included in Kotlin 1.3, but rather in some later versions. Nevertheless, I believe the AAR in the build directory is completely valid and eligible for use. You can try to publish them like this:
<https://stackoverflow.com/a/39252262/2196460>
or this:
<https://github.com/wupdigital/android-maven-publish>
Regarding to the example: indeed, it requires a small correction, I’ll try to push the fix soon, sorry for the inconvenience. Yet, the lib part from there isn’t supposed to be published: there is no such configuration like the one described here: https://github.com/h0tk3y/k-new-mpp-samples#publishing-and-mpp-library-dependencies. To try out the lib publishing with its consequent usage, you may take a look at this example: https://github.com/h0tk3y/k-new-mpp-samples/tree/master/lib-and-app. It doesn’t have Android target, but gives the main idea. And the latest note: the best plugin version to be used currently is the latest Kotlin 1.3-RC, which is
1.3.0-rc-57
. It is recommended to update the dependencies to have the latest fixes and updates for MPP as well. Also, don’t forget to specify EAP repo for it:
maven { url '<https://dl.bintray.com/kotlin/kotlin-eap>' }
k

kpgalligan

09/21/2018, 1:44 PM
Thanks for the reply. I was having trouble with mpp and digital.wup.android-maven-publish previously, but seem to be able to locally publish with that now.
Android and iOS libraries are our primary use case. Pretty much the only use case right now. Being able to publish them is obviously important. A functional example would be very useful I think. I am concerned that we'll run into issues on the aar side as libraries have transitive dependencies. I'm going to spend the next few hours trying to get this to work. See how it goes. May need to revisit after the conference, though.
l

Liliia

09/21/2018, 2:33 PM
Thank you for the feedback! You are more than welcome to ask more questions arising on the way. We are working on the functional example right now, its importance indeed clear enough. I’ll certainly let you know when it’s ready
k

kpgalligan

09/21/2018, 3:24 PM
I was able to publish to bintray and consume the aar in an android app directly, but haven't tried using the multiplatform dependency yet
l

Liliia

09/21/2018, 4:28 PM
Which way did you use to publish it?
View count: 3