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
compose-desktop
  • e

    eygraber

    11/06/2020, 2:53 AM
    I've been trying to test this out in a multiplatform project with Android and jvm (I only did the jvm part for now for simplicity), but when I try to invoke the
    run
    task, Gradle throws an Exception:
    A problem occurred configuring project ':desktopApp'.
    > Could not create task ':desktopApp:run'.
       > at index 0
    Here are my gradle files: root
    buildscript {
        repositories {
            jcenter()
            maven("<https://maven.pkg.jetbrains.space/public/p/compose/dev>")
        }
    
        dependencies {
            classpath("org.jetbrains.compose:compose-gradle-plugin:0.1.0-m1-build62")
            classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.10")
        }
    }
    
    allprojects {
        repositories {
            jcenter()
            maven("<https://maven.pkg.jetbrains.space/public/p/compose/dev>")
        }
    }
    shared
    import org.jetbrains.compose.compose
    
    plugins {
        kotlin("multiplatform")
        id("org.jetbrains.compose")
    }
    
    kotlin {
        jvm()
    
        sourceSets {
            val commonMain by getting {
                dependencies {
                    api(compose.runtime)
                    api(compose.foundation)
                    api(compose.material)
                    api(compose.materialIconsExtended)
                }
            }
    
            val jvmMain by getting {
                dependsOn(commonMain)
                dependencies {
                    api(compose.desktop.common)
                }
            }
        }
    }
    desktop
    import org.jetbrains.compose.compose
    import org.jetbrains.compose.desktop.application.dsl.TargetFormat
    
    plugins {
        kotlin("multiplatform")
        id("org.jetbrains.compose")
    }
    
    kotlin {
        jvm {
            withJava()
        }
    
        sourceSets {
            val commonMain by getting {
                dependencies {
                    implementation(project(":shared"))
                }
            }
    
            val jvmMain by getting {
                dependsOn(commonMain)
                dependencies {
                    implementation(compose.desktop.currentOs)
                }
            }
        }
    }
    
    compose.desktop {
        application {
            mainClass = "com.compose.desktop.DesktopAppKt"
    
            nativeDistributions {
                targetFormats(TargetFormat.Deb)
                packageName = "ComposeHelloWorldDesktop"
            }
        }
    }
    • 1
    • 1
  • e

    eygraber

    11/06/2020, 5:30 AM
    Is there a mapping that shows what version of the actual androidx artifacts will be used from an Android target?
    i
    • 2
    • 3
  • g

    Grigorii Yurkov

    11/06/2020, 6:08 AM
    Can I use compose desktop for my coursework 🤔
    a
    • 2
    • 1
  • k

    Karthick

    11/06/2020, 7:58 AM
    Is it would be nice for package name as
    google.compose
    instead of
    androidx.compose
    to support multi-platform
    🤔 2
    ✔️ 4
    d
    l
    +4
    • 7
    • 8
  • a

    Animesh Sahu

    11/06/2020, 10:20 AM
    Anybody gettting
    Class 'androidx.compose.desktop.AppWindowKt' is compiled by a new Kotlin compiler backend and cannot be loaded by the old compiler
    when using Kotlin 1.4.10?
    d
    i
    • 3
    • 6
  • k

    Karthick

    11/06/2020, 11:27 AM
    Will navigation work in desktop
    a
    • 2
    • 1
  • d

    delblanco

    11/06/2020, 11:35 AM
    Tried to play with the Gitlab issues examples and got the following exception when running desktop application:
    > Task :desktop:run
    Exception in thread "AWT-EventQueue-0" java.lang.UnsupportedClassVersionError: org/jetbrains/skiko/Library has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
    ✅ 1
    m
    o
    u
    • 4
    • 10
  • l

    Luc Girardin

    11/06/2020, 12:43 PM
    I am wondering if there is ever going to be a Compose for Web. Is there already work going in this direction?
    k
    a
    +4
    • 7
    • 12
  • g

    Grigorii Yurkov

    11/06/2020, 1:16 PM
    How to draw point set on
    Canvas
    ?
    drawPoints
    doesn't work
    i
    • 2
    • 3
  • y

    Yan Pujante

    11/06/2020, 1:22 PM
    I have been wanting to write an application that would use the macOS menubar icon tray and notification. I had been putting it off because of the thought of having to write it in Swift (or worse Objective-C). The fact that I can now do it in Kotlin with #compose-desktop is mega exciting! 😛arty-parrot:
    t
    • 2
    • 2
  • g

    Glen

    11/06/2020, 1:42 PM
    I saw that Flutter uses Skia for rendering both on Android and iOS. Then it means that, Jetbrains Compose would be able to do the same in the future(or maybe now). But in order for that to succeed, would it need the Kotlin/Native runtime?
    :blob-thinking-upside-down: 1
    🤔 1
    a
    b
    +3
    • 6
    • 10
  • a

    Animesh Sahu

    11/06/2020, 3:20 PM
    https://stackoverflow.com/questions/64717218/how-to-sync-build-gradle-kts-settings-with-intellij-linter any idea how to sync gradle compilation options with intellij linter?
    s
    s
    • 3
    • 6
  • z

    Zach Klippenstein (he/him) [MOD]

    11/06/2020, 6:30 PM
    Compose desktop has what seem to be low level apis for detecting mouse pointer enter/exit. I believe, based on comments in various CLs, that there are plans to support pointers on android as well, since it is possible to use a mouse on android (both on android devices and chrome os). Enter/exit seems like it should usually be handled via an ‘InteractionState’ for “hover”. Is this sort of thing in the works?
    👀 3
    j
    m
    o
    • 4
    • 5
  • s

    spierce7

    11/06/2020, 6:56 PM
    So what parts of compose desktop are lacking compared to compose android?
    j
    d
    +5
    • 8
    • 21
  • s

    spierce7

    11/06/2020, 7:07 PM
    Does anyone else experience severe lag on the ImageViewer application? I’m assuming that’s because the images are all being loaded and handled on a single thread, and the images I’m seeing are fairly large.
    ☝️ 1
    d
    o
    • 3
    • 2
  • d

    Draget

    11/06/2020, 7:12 PM
    I know this is a kind of provokative questions, but I need to ask: Why not a Kotlin API to JavaFX? JavaFX really seems to take off recently. (I know there is TornadoFX, but the guy behind it is kind of a lone-soilder and it is not really a 1:1 mapping of ithe API). And if it is about modern declarative GUIs with mobile and desktop support from the ground up… what about Flutter? o.o
    🙌 1
    b
    r
    • 3
    • 5
  • d

    Draget

    11/06/2020, 8:07 PM
    I am currently working throug the example in the Getting Started README: https://github.com/JetBrains/compose-jb/blob/master/tutorials/Getting_Started/README.md and already got stuck. I get 'Class 'androidx.compose.ui.unit.IntSize' is compiled by a new Kotlin compiler backend and cannot be loaded by the old compiler' on several keywords. Any idea what I could be missing?
    b
    a
    +2
    • 5
    • 31
  • m

    Misterixis

    11/06/2020, 8:55 PM
    Hello, I try to understand, how compose-desktop works in general. Is there any doc, which describes it? I saw, that this project has integration with Swing, also it is connected with skia. However, I don't know, is it just Swing wrapper, or something more, that this (I mean, who is responsible for rendering UI elements)
    o
    r
    • 3
    • 3
  • d

    Dumitru Preguza

    11/06/2020, 9:29 PM
    Are there any plans to build something like a Scene Builder as in JavaFx (but without xml..) ? The multiplatform framework is fine but writing the UI entirely by hand will take a long time I think, so it would be useful to have some tools which would speed up this process 🙂.
    g
    • 2
    • 1
  • s

    spierce7

    11/06/2020, 10:08 PM
    How would I go about setting a min width and height for the desktop window? I haven’t found a way to get access to the underlying JFrame
    r
    • 2
    • 2
  • m

    Marcin Wisniowski

    11/06/2020, 10:51 PM
    This was just released. You try it out and see how updating can look. You write the Compose testing blog post that will be referenced for years to come. It's experimental tech at this point, there are no established patterns, unless you establish them.
    :thread-please: 1
    👆 4
    s
    a
    i
    • 4
    • 8
  • b

    Ben Woodworth

    11/07/2020, 2:23 AM
    I just started digging into this, so I might be missing something obvious, but is there a way to use a system look-and-feel (à la Swing)? I couldn't figure anything out with/without `MaterialTheme`/`DesktopTheme` and whatnot
    j
    • 2
    • 2
  • s

    spierce7

    11/07/2020, 8:16 PM
    There are no navigation/backstack libraries compatible with compose desktop, right?
    a
    • 2
    • 2
  • j

    John O'Reilly

    11/07/2020, 8:24 PM
    Are there any examples of including a Swing component? I'm looking to see if I can use https://github.com/msteiger/jxmapviewer2 to show a map. All I've seen so far is that I can do following but adding to that using something like
    jFrame.contentPane.add(mapViewer)
    isn't working
    val current = AppManager.getCurrentFocusedWindow()
    val jFrame = current.window
    j
    o
    +2
    • 5
    • 14
  • u

    ubu

    11/07/2020, 11:38 PM
    Hello there! Has anyone had this issue when trying to run desktop template:
    dyld: lazy symbol binding failed: Symbol not found: _objc_opt_new
      Referenced from: /Users/eugene/.skiko/b9408918342fa3c0511232e1869d6b3885a57b45a57800586f357a2461785a4e/libskiko.dylib (which was built for Mac OS X 10.15)
      Expected in: /usr/lib/libobjc.A.dylib
    
    dyld: Symbol not found: _objc_opt_new
      Referenced from: /Users/eugene/.skiko/b9408918342fa3c0511232e1869d6b3885a57b45a57800586f357a2461785a4e/libskiko.dylib (which was built for Mac OS X 10.15)
      Expected in: /usr/lib/libobjc.A.dylib
    
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':run'.
    > Process 'command '/Users/eugene/Library/Java/JavaVirtualMachines/openjdk-15.0.1/Contents/Home/bin/java'' finished with non-zero exit value 134
    
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
    
    * Get more help at <https://help.gradle.org>
    
    BUILD FAILED in 16s
    Couldn’t fix it (spent a while trying different JDK). Suggestions from https://kotlinlang.slack.com/archives/C01D6HTPATV/p1604662532185700 didn’t work for me.
    j
    o
    • 3
    • 4
  • i

    Igor Brishkoski

    11/08/2020, 2:50 PM
    Trying to build windows docker image from here https://github.com/JetBrains/compose-jb/tree/master/ci/docker/windows but I’m getting this error. Any idea what’s going on?
    ------
     > [1/19] FROM <http://mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019@sha256:2506aed9fa9adec7118a1058d117b5ff579fa0c74f9a47bece4008593a057e5d|mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019@sha256:2506aed9fa9adec7118a1058d117b5ff579fa0c74f9a47bece4008593a057e5d>:
    ------
    failed to solve with frontend dockerfile.v0: failed to build LLB: failed to register layer: Error processing tar file(exit status 1): link /Files/Program Files/common files/Microsoft Shared/Ink/en-US/micaut.dll.mui /Files/Program Files (x86)/common files/Microsoft Shared/ink/en-US/micaut.dll.mui: no such file or directory
    o
    • 2
    • 8
  • s

    SrSouza

    11/08/2020, 4:05 PM
    Folks, CfD does not support SVG and Android's Vector Drawables yet, right?
    z
    • 2
    • 1
  • s

    SrSouza

    11/08/2020, 4:55 PM
    Hi folks, I want to share the project that I'm working on focus mainly in Compose for Desktop because it does not support Vectors yet, no SVG, no Android's Vector Drawable. So a create a simple project to convert SVG and Android's Vector Drawable to Compose code. https://github.com/DevSrSouza/svg-to-compose For now, this will help port simple vectors and icon packs to Compose for Desktop, allowing you to share it with Desktop and Android app. Here you can see the Jetnews Logo in the Compose for Desktop version
    🎉 17
    j
    j
    c
    • 4
    • 6
  • t

    Timo Drick

    11/09/2020, 12:37 AM
    I just experimenting with ImageAsset and Image. I am constructing the Image from a bytestream using
    Image.makeFromEncoded(compressedImage.byteArray).asImageAsset()
    It looks like the memory allocation for the image is not freed automatically when i remove all references to the ImageAsset. What do i have to do to cleanup the memory when i do not need the image anymore? In android i do have to call Bitmap.recycle but for Image i only found Image.reset which do not free the memory.
    r
    j
    • 3
    • 4
  • z

    Zimri Leisher

    11/09/2020, 4:44 AM
    and im also getting something like "class <> is compiled by a new kotlin compiler backend and cannot be loaded by the old compiler
    a
    • 2
    • 1
Powered by Linen
Title
z

Zimri Leisher

11/09/2020, 4:44 AM
and im also getting something like "class <> is compiled by a new kotlin compiler backend and cannot be loaded by the old compiler
a

Animesh Sahu

11/09/2020, 5:08 AM
https://kotlinlang.slack.com/archives/C01D6HTPATV/p1604724944279600?thread_ts=1604693255.240600&amp;cid=C01D6HTPATV
View count: 5