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

    MBegemot

    04/24/2020, 7:40 AM
    There should be something broke in Material theme, till dev 6 I did not noticed anything weird, but now when I change the theme of the app at runtime very strange things happen, for example I have a list display function that only works well (in the theming sense ) if I surround it by a surface(shape=Rectangle), either if I skip the surface or the shape, the list goes drawn without the changed theme. And there are more quirks and oddities all of them hard to predict or imagine.
    a
    l
    2 replies · 3 participants
  • c

    camkadev

    04/24/2020, 3:15 PM
    var authState by state { AuthState() }
    complaint about
    Functions which invoke @Composable functions must be marked with the @Composable annotation
    what should i do?
    z
    c
    +1
    17 replies · 4 participants
  • a

    alexzhukovich

    04/24/2020, 5:47 PM
    I published an article about Themes and Typography in Jetpack Compose. I will be happy to hear a feedback and I hope it will be helpful https://alexzh.com/jetpack-compose-theme-and-typography/
    👍 7
    l
    s
    +1
    9 replies · 4 participants
  • k

    Kazemihabib1996

    04/25/2020, 2:30 PM
    Thanks for dev09, considering the new Alignment API design, for example when using
    Modifier.gravity()
    inside
    ColumnScope
    the IDEA suggests whole alignments as they are all defined in componian object of`Alignment` class but our ColumnScope
    gravity Modifier
    just accepts
    Alignment.Horizontal
    and IMHO this API needs some modifications.
    a
    g
    +1
    7 replies · 4 participants
  • c

    carbaj0

    04/25/2020, 5:52 PM
    The dev09 don't allow delegation in
    state
    , there is some special technical reason?
    l
    a
    3 replies · 3 participants
  • i

    itnoles

    04/25/2020, 6:26 PM
    What happens to old Compose Preview run without Emulator?
    f
    c
    +1
    4 replies · 4 participants
  • c

    caelum19

    04/25/2020, 10:26 PM
    Hey I'm having some difficulties using ConstraintLayout. I expect this blue box to be at the bottom, am I doing it wrong somehow?
    Untitled
    g
    19 replies · 2 participants
  • s

    Sheroz Nazhmudinov

    04/26/2020, 1:31 PM
    hey, is there any good reference for the compose api to draw the shapes for custom UI elements (and make them user intractable)? So I was using canvas fo that purpose, and wanted to clarify if that’s the right approach?
    a
    a
    11 replies · 3 participants
  • c

    Colton Idle

    04/26/2020, 5:00 PM
    Still new to compose, but something I do often in the traditional UI toolkit is set images up using an aspect ratio. We do this on just about every imageview since it scales best across devices sizes, resolutions, etc. Does compose have an easy way to add an imageview to be sized as 16:9, 3:4, 1:1 etc? As per material guidelines:
    m
    v
    3 replies · 3 participants
  • d

    david.bilik

    04/26/2020, 5:18 PM
    👋, Is the API in AS 4+ for preview of Compose/Custom views open? We are using Anko currently and it would be great if we could leverage this preview until the compose is stable. Official Preview from Anko never really worked. Thanks!
    👍 1
    k
    i
    +1
    6 replies · 4 participants
  • s

    spierce7

    04/26/2020, 11:12 PM
    Has there been any word as to when we’ll see a formal beta for compose? I thought we were going to hear something for GoogleIO, but since it’s not happening I thought I’d ask.
    🇳🇴 2
    v
    1 reply · 2 participants
  • a

    aipok

    04/27/2020, 7:13 AM
    Does anyone have
    dev09
    working. For me with latest AS 4.1 canary 7 and
    dev09
    the preview not displayed and every time I’m trying to run the code on the device it gives me an error
    java.lang.NoSuchMethodError: No static method setContent(Landroidx/activity/ComponentActivity;Lkotlin/jvm/functions/Function0;)Landroidx/compose/Composition
    k
    g
    3 replies · 3 participants
  • m

    molikto

    04/28/2020, 6:51 AM
    after updates to today's snapshot it seems AdapterList will not scroll anymore, it can be seen in Foundation > Lists > Simple List. But I haven't been updating my snopshot version for a long time, so not sure when it is introduced.
    r
    7 replies · 2 participants
  • s

    ShreemanArjun

    04/28/2020, 7:48 AM
    How to navigate from one activity to another activity containing composable function?
    m
    v
    2 replies · 3 participants
  • b

    Brian Gardner

    04/28/2020, 1:32 PM
    @Leland Richardson [G] Ok, so I tried using the
    state{}
    to wrap the list but the
    AdapterList
    is still not updating when I change the data. I tried both
    ReferentiallyEqual
    and
    StructurallyEqual
    for the
    state
    parameter. I also tried moving the state down to the individual row views themselves. This does cause the row to update when the user interacts with it but if the item scrolls off screen and comes back on then it is composed with the old state since nothing told the list component to change the state. I'll do some digging into React to see what their best practices are for dealing with list state
    a
    l
    7 replies · 3 participants
  • g

    Guy Bieber

    04/28/2020, 7:05 PM
    I am using dev-09 and having an issue on subsequent calls to setContext, particularly from composable functions. Here is the code:
    setContent {
                            MaterialTheme {
                                //for some reason this gets an error
                                //pageData.page()
    
                                // moved to a switch statement
                                when (page) {
                                    Pages.SPLASH_PAGE -> {
                                        SplashPage()
                                    }
                                    Pages.LOGIN_PAGE -> {
                                        LoginPage()
                                    }
                                    Pages.RESET_PASSWORD_PAGE -> {
                                        ForgotPasswordPage()
    Here is the error:
    2020-04-28 11:55:16.113 26150-26150/com.nikolamotor.nikolamotor E/AndroidRuntime: FATAL EXCEPTION: main
        Process: com.nikolamotor.nikolamotor, PID: 26150
        java.lang.IllegalArgumentException: Start/end imbalance
            at androidx.compose.Composer.finalizeCompose(Composer.kt:1595)
            at androidx.compose.Composer.endRoot(Composer.kt:509)
            at androidx.compose.Recomposer.recompose(Recomposer.kt:79)
            at androidx.compose.Recomposer.access$recompose$1(Unknown Source:0)
            at androidx.compose.Recomposer$Companion.recompose$compose_runtime_release(Recomposer.kt:56)
            at androidx.compose.CompositionImpl.setContent(Composition.kt:91)
            at androidx.ui.core.WrappedComposition.setContent(Wrapper.kt:221)
            at androidx.ui.core.WrapperKt.doSetContent(Wrapper.kt:201)
            at androidx.ui.core.WrapperKt.setContent(Wrapper.kt:156)
            at androidx.ui.core.WrapperKt.setContent(Wrapper.kt:129)
            at com.nikolamotor.nikolamotor.MainActivity$PageControl.SwitchPage(MainActivity.kt:207)
            at com.nikolamotor.nikolamotor.MainActivity$HomePage$3.invoke(MainActivity.kt:499)
            at com.nikolamotor.nikolamotor.MainActivity$HomePage$3.invoke(Unknown Source:6)
            at androidx.compose.internal.RestartableFunction.invoke(RestartableFunction.kt:140)
            at androidx.compose.internal.RestartableFunction$invoke$1.invoke(RestartableFunction.kt:141)
            at androidx.compose.internal.RestartableFunction$invoke$1.invoke(Unknown Source:3)
            at androidx.compose.RecomposeScope.compose(Composer.kt:265)
            at androidx.compose.Composer.composeScope(Composer.kt:1431)
            at androidx.compose.Composer.recomposeComponentRange(Composer.kt:1377)
            at androidx.compose.Composer.skipCurrentGroup(Composer.kt:1426)
            at androidx.compose.Composer.recompose(Composer.kt:1495)
            at androidx.compose.Recomposer.performRecompose(Recomposer.kt:107)
            at androidx.compose.Recomposer.dispatchRecomposes(Recomposer.kt:135)
            at androidx.compose.AndroidRecomposer.access$dispatchRecomposes$1(Unknown Source:0)
            at androidx.compose.AndroidRecomposer$frameCallback$1.doFrame(AndroidRecomposer.kt:27)
            at android.view.Choreographer$CallbackRecord.run(Choreographer.java:965)
            at android.view.Choreographer.doCallbacks(Choreographer.java:791)
            at android.view.Choreographer.doFrame(Choreographer.java:722)
            at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:952)
            at android.os.Handler.handleCallback(Handler.java:883)
            at android.os.Handler.dispatchMessage(Handler.java:100)
            at android.os.Looper.loop(Looper.java:214)
            at android.app.ActivityThread.main(ActivityThread.java:7356)
            at java.lang.reflect.Method.invoke(Native Method)
            at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
    Any thoughts? Note I can call the same function from back and it works every time (outside a composable function)
    //@Composable
        override fun onBackPressed() {
            pg.BackPage()
            //super.onBackPressed()
        }
    fun BackPage () {
                if (currentPage != <http://Pages.NO|Pages.NO>_PAGE) {
                    val pageData = pageMap[currentPage]
                    if (pageData != null) {
                        // this page has a specific back page
                        if (pageData.backPage != <http://Pages.NO|Pages.NO>_PAGE) {
                            SwitchPage(pageData.backPage)
                        // this go back to
                        } else if (priorPage != <http://Pages.NO|Pages.NO>_PAGE){
                            SwitchPage(priorPage)
                        }
                    }
                }
            }
    a
    v
    9 replies · 3 participants
  • c

    Colton Idle

    04/29/2020, 9:06 AM
    For anyone not on twitter, I listened to this podcast with Leland. Very awesome. I still need to dig more on some of the topics that were covered like why just having your UI in xml and logic in kotlin not actually real separation of concerns. It's definitely a big mindset shift. https://fragmentedpodcast.com/episodes/196/
    🙂 3
    l
    18 replies · 2 participants
  • k

    Kazemihabib1996

    04/29/2020, 4:48 PM
    I can't understand this version of
    fling
    animation
    fun AnimatedFloat.fling(
        startVelocity: Float,
        decay: DecayAnimation = ExponentialDecay(),
        adjustTarget: (Float) -> TargetAnimation?,
        onEnd: OnAnimationEnd? = null
    )
    it accepts a
    startVelocity
    and
    decay
    so far it makes sence. but it also accepts an
    adjustTarget
    that's the what I can't understand, setting new target with new animation inside fling animation?
    m
    4 replies · 2 participants
  • l

    Leland Richardson [G]

    04/29/2020, 5:39 PM
    Big note on this release: We have rebased with a much more recent version of the kotlin compiler, which means that coroutines are supported! We have some coroutine-specific API changes that will be coming down the pipeline which i’m really excited for, but this will at least unblock a lot of things some of you were trying!
    🎊 12
    😒uspend: 4
    🎉 50
    b
    l
    +2
    7 replies · 5 participants
  • g

    Guy Bieber

    04/29/2020, 5:56 PM
    Two questions: 1. I am trying to setup some data structures that point to my @Model data in onCreate. This gets an exception:
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.nikolamotor.nikolamotor/com.nikolamotor.nikolamotor.MainActivity}: java.lang.IllegalStateException: Not in a frame
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3270)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
            at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
            at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
            at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
            at android.os.Handler.dispatchMessage(Handler.java:107)
            at android.os.Looper.loop(Looper.java:214)
            at android.app.ActivityThread.main(ActivityThread.java:7356)
            at java.lang.reflect.Method.invoke(Native Method)
            at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
         Caused by: java.lang.IllegalStateException: Not in a frame
            at androidx.compose.frames.FramesKt.currentFrame(Frames.kt:180)
            at androidx.compose.frames.FramesKt.readable(Frames.kt:448)
            at androidx.compose.frames.FramesKt._readable(Frames.kt:461)
            at com.nikolamotor.nikolamotor.DataModel.getTemperature(Unknown Source:5)
            at com.nikolamotor.nikolamotor.MainActivity.onCreate(MainActivity.kt:95)
            at android.app.Activity.performCreate(Activity.java:7825)
            at android.app.Activity.performCreate(Activity.java:7814)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1306)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409) 
            at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) 
            at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) 
            at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) 
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016) 
            at android.os.Handler.dispatchMessage(Handler.java:107) 
            at android.os.Looper.loop(Looper.java:214) 
            at android.app.ActivityThread.main(ActivityThread.java:7356) 
            at java.lang.reflect.Method.invoke(Native Method) 
            at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) 
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
    Here is the data model:
    @Model
    data class DataModel (
        var username : String = "dude",
        var password : String = "blah",
        var oldPage : Pages = Pages.SPLASH_PAGE,
        var newPage : Pages = Pages.SPLASH_PAGE,
        var temperature : Int = 72
    )
    
    var dataModel = DataModel()
    Here is the onCreate code:
    override fun onCreate(savedInstanceState: Bundle?) {
            super.onCreate(savedInstanceState)
    
            // NOTE many items can't be constructed until onCreate is called
            ui = UiStyled(this)
            pg = PageControl(this)
            homePageControls  = arrayOf(
                //Row 1
                BasicControl(
                    icon = imageFromResource(resources, R.drawable.fan_lvl_0),
                    name = resources.getString(R.string.home_auto)
                ),
                VertTempControl(
                    temp = dataModel.temperature,
                    step = 1
                ),
    l
    4 replies · 2 participants
  • g

    Guy Bieber

    04/29/2020, 6:01 PM
    2. What is the correct way to bind data from your @Model to a @Composable function parameter? Here is an example:
    data class VertTempControl (
        var temp : Int = 72,
        var step : Int = 1
    ) : Control()
    ...
    @Model
    data class DataModel (
        var username : String = "dude",
        var password : String = "blah",
        var oldPage : Pages = Pages.SPLASH_PAGE,
        var newPage : Pages = Pages.SPLASH_PAGE,
        var temperature : Int = 72
    )
    var dataModel = DataModel()
    ...
                var vt = VertTempControl(
                    temp = dataModel.temperature,
                    step = 1
                ) 
    ...
    showControl (vt)
    z
    3 replies · 2 participants
  • a

    Andrey Kulikov

    04/29/2020, 6:42 PM
    Note that
    Flow
    integration should work fine with dev10 if you want to try it. unfortunately we didn't merge the adapter before the build cut, so it will be added in dev11. but feel free to temporary copy it from here and play with it
    🎉 2
    🙏🏼 8
    s
    f
    5 replies · 3 participants
  • i

    itnoles

    04/29/2020, 9:07 PM
    When I tried to assembleDebug in dev10, I gets incompatible kotlin api error that is asking for 1.4
    l
    j
    16 replies · 3 participants
  • g

    Gabriel Feo

    04/29/2020, 11:25 PM
    Just out of curiosity, is it a convention from somewhere to name constants in UpperCamelCase? This is from
    Constraints2
    I think I like it
    z
    a
    +1
    9 replies · 4 participants
  • l

    louiscad

    04/30/2020, 2:36 AM
    The setup snippet here is misleading: https://developer.android.com/jetpack/androidx/releases/compose#declaring_dependencies
    kotlinPlugin
    may be a configuration that will actually exist in Kotlin 1.4 or 1.5 at some point, but it's nowhere to be found in 1.3.72, nor 1.4-M1. The
    kotlinCompilerExtensionVersion = "0.1.0-dev10"
    is the replacement, while the page shows both. I lost some time with it that I'd have preferred to spend playing with Compose itself, or something else. Would be great that this doc stops to be misleading by removing the line, until the configuration actually exists. EDIT: Reported the issue: https://issuetracker.google.com/issues/155323417
    i
    3 replies · 2 participants
  • l

    louiscad

    04/30/2020, 3:09 AM
    I'm using freshly setup Compose dev10 on an existing Kolin 1.3.72 project, but compilation of the app module now fails at the `prepareDebugKotlinCompileTask`with that message:
    Execution failed for task ':some-parent-project:app-android:prepareDebugKotlinCompileTask'.
    > org/jetbrains/kotlin/gradle/tasks/KotlinCompile
    How can I find the root cause?
    m
    d
    +1
    9 replies · 4 participants
  • z

    Zach Klippenstein (he/him) [MOD]

    04/30/2020, 5:22 AM
    I’m using kotlin 1.3.72, and after updating to compose dev10 I got warnings about
    Runtime JAR files in the classpath have the version 1.3, which is older than the API version 1.4. Consider using the runtime of version 1.4
    . These go away if I add the
    apiVersion = "1.3"
    configuration for my
    KotlinCompile
    tasks, and the code runs fine. Are these warnings expected? Should we be using Kotlin 1.4-M1 to use Compose now?
    ➕ 4
    l
    3 replies · 2 participants
  • n

    nicopasso

    04/30/2020, 7:49 AM
    java.lang.LinkageError: loader constraint violation: when resolving method "kotlin.coroutines.AbstractCoroutineContextKey.<init>(Lkotlin/coroutines/CoroutineContext$Key;Lkotlin/jvm/functions/Function1;)V" the class loader (instance of org/jetbrains/android/uipreview/ModuleClassLoader) of the current class, kotlinx/coroutines/CoroutineDispatcher$Key, and the class loader (instance of com/intellij/ide/plugins/cl/PluginClassLoader) for the method's defining class, kotlin/coroutines/AbstractCoroutineContextKey, have different Class objects for the type kotlin/coroutines/CoroutineContext$Key used in the signature
    	at kotlinx.coroutines.CoroutineDispatcher$Key.<init>(CoroutineDispatcher.kt:35)
    	at kotlinx.coroutines.CoroutineDispatcher$Key.<init>(CoroutineDispatcher.kt:35)
    	at kotlinx.coroutines.CoroutineDispatcher.<clinit>(CoroutineDispatcher.kt)
    	at kotlinx.coroutines.CoroutineContextKt.createDefaultDispatcher(CoroutineContext.kt:23)
    	at kotlinx.coroutines.Dispatchers.<clinit>(Dispatchers.kt:33)
    	at androidx.ui.core.WrapperKt$doSetContent$compositionWrapper$1$setContent$1.invoke(Wrapper.kt:178)
    	at androidx.ui.core.WrapperKt$doSetContent$compositionWrapper$1$setContent$1.invoke(Wrapper.kt)
    	at androidx.compose.internal.RestartableFunction.invoke(RestartableFunction.kt:132)
    	at androidx.compose.internal.RestartableFunction.invoke(RestartableFunction.kt)
    	at androidx.compose.ComposerKt.invokeComposable(Composer.kt:2052)
    	at androidx.compose.Recomposer.recompose(Recomposer.kt:77)
        ...
    j
    a
    +1
    10 replies · 4 participants
  • j

    jitinsharma

    04/30/2020, 8:41 AM
    For shape, preferred method would be `imageResource`/`loadImageResource`
    d
    1 reply · 2 participants
  • j

    jitinsharma

    04/30/2020, 9:17 AM
    Room is working with
    dev-10
    🎉
    🎉 13
    a
    a
    +3
    7 replies · 6 participants
Powered by Linen
Title
j

jitinsharma

04/30/2020, 9:17 AM
Room is working with
dev-10
🎉
🎉 13
a

Arun

04/30/2020, 9:34 AM
That means any project with
kapt
should work?
j

jitinsharma

04/30/2020, 9:43 AM
Could not find mention of
kapt
in release notes. You’ll have to try and check with other libs.
a

Adrian Blanco

04/30/2020, 10:00 AM
Dagger works as well, so would guess so
v

Vinay Gaba

04/30/2020, 3:20 PM
yeah I think kapt will start to work now. Leland had confirmed this as well - https://kotlinlang.slack.com/archives/CJLTWPH7S/p1587533383384300
l

Leland Richardson [G]

04/30/2020, 4:25 PM
Looks like this person had luck with Room as well: https://github.com/jbarr21/appdialer/commit/0a7072e10d14c96cf774bc98db30b89abc0d370c#diff-863e98cb3c8f40e0692c9d27cd349e29 Example gradle config for those curious. I think using 1.3.70 instead of 1.3.72 might be important. I will talk with some folks about updates to the release notes that we can make
a

Arun

05/01/2020, 1:02 AM
Can confirm works with Dagger. Great news 👍🏻
a

Ali Zargar Shabestari

05/02/2020, 4:59 AM
I can confirm works with room just fine🤗
View count: 1