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
squarelibraries
  • s

    Sergio Crespo Toubes

    07/02/2019, 12:59 PM
    After updating my app to
    OkHttp:4.0.0
    i am getting this error
    SSLHandshakeException: Handshake failed
    can someone know what changed? Thanks.
    g
    • 2
    • 5
  • j

    jw

    07/06/2019, 10:56 PM
    Sure. Wrap your loop in a transaction
    k
    • 2
    • 3
  • j

    jw

    07/07/2019, 5:12 PM
    I tend to abstract at a higher level since some semantic operation from the UI might want to execute multiple queries
    k
    • 2
    • 7
  • m

    mathew murphy

    07/17/2019, 4:08 PM
    What I can't work out is how to combine these two features, so that my
    moshi
    variable knows about
    BlackjackHand
    and has an adapter for it. I can't call
    moshi.adapter
    until I have called
    .build()
    , and once I've called
    .build()
    I can't work out how to add another adapter to the set.
    g
    m
    d
    • 4
    • 66
  • k

    kartoffelsup

    07/18/2019, 2:00 PM
    It does not compile unfortunately
    e
    • 2
    • 5
  • s

    Sergioedcigreja

    07/22/2019, 9:49 AM
    Hello, I'm still getting this error that prevents me from building my iOS Application. It started occurring when I imported SQLDelight to my multiplatform project. Any ideas on what to do? It says that it cannot find the declarationg of LibKotlinCoroutineContextElement but in the line 986 there is a protocol with that name.
    t
    • 2
    • 12
  • k

    kevin.cianfarini

    07/28/2019, 1:42 PM
    When using the Android Paging extension for SQLDelight, are we expected to use LiveData to observe the list and submit it to a
    ListAdapter
    ?
    • 1
    • 1
  • j

    jw

    07/28/2019, 7:21 PM
    You might have to wait a day, but @alec will know
    k
    a
    • 3
    • 3
  • m

    Mike R

    07/29/2019, 11:00 PM
    Running into a slight issue with Retrofit2 and serialization of custom types. This is how I'm creating my Retrofit instance:
    this.rfBuilder.apply {
                baseUrl(BASE_URL)
                addConverterFactory(
                    GsonConverterFactory.create(
                        GsonBuilder().apply {
                            registerTypeAdapter(SearchQuery::class.java, SearchQueryAdapter())
                            excludeFieldsWithoutExposeAnnotation()
                            setPrettyPrinting()
                        }.create()
                    )
                )
                client(
                    OkHttpClient.Builder().apply {
                        addInterceptor { chain ->
                            val original = chain.request()
    
                            val requestBuilder = original.newBuilder().addHeader("User-Agent", USER_AGENT)
                            val request = requestBuilder.build()
                            chain.proceed(request)
                        }
                    }.build()
                )
            }
    I've created a SearchQueryAdapter that implements
    JsonSerializer
    and the
    serialize
    function. This is my function declaration in my Retrofit service:
    @GET("posts")
        fun searchListings(
            @Query("request") searchQuery: SearchQuery,
            @Query("count") count: Int = 50,
            @Query("max_id") maxId: Int = 1
        ): Call<GetListingsResponse>
    What's happening is that the query parameter for searchQuery doesn't serialize in that the value of the parameter becomes
    SearchQuery( <serialized content here>)
    , which isn't valid for the API. What am I doing wrong here?
    g
    • 2
    • 3
  • r

    ribesg

    07/30/2019, 11:02 AM
    I’m trying to use Sqldelight in a JVM project and IntelliJ doesn’t see the generated code, anyone knows why?
    r
    • 2
    • 11
  • j

    julioyg

    07/31/2019, 12:26 PM
    Hi there, this one is not totally related with Kotlin, so apologies in advance, but I've just updated our Dagger version to its latests, and spot this warning
    warning: dagger.gradle.incremental is no longer recognized by Dagger
    does that mean that incremental processing is not a thing anymore or that it's enabled by default or... somthing else?
    s
    g
    • 3
    • 3
  • t

    Thomas

    07/31/2019, 9:57 PM
    Will SQLDelight get a pre-release for Kotlin 1.3.50? That will give the possibility to test if everything works fine for Kotlin/Native 1.3.50. I would really like to try out Kotlin 1.3.50 but I can’t because SQLDelight has no release for that Kotlin version.
    ☝️ 2
    l
    • 2
    • 4
  • k

    kevin.cianfarini

    08/03/2019, 4:50 PM
    java.lang.IllegalArgumentException: Unable to create converter for com.kevincianfarini.saddle.data.network.PaginatedResponse<com.kevincianfarini.saddle.Artist>
            for method SaddleAPI.getArtists
            at retrofit2.Utils.methodError(Utils.java:52)
            at retrofit2.HttpServiceMethod.createResponseConverter(HttpServiceMethod.java:115)
            at retrofit2.HttpServiceMethod.parseAnnotations(HttpServiceMethod.java:82)
            at retrofit2.ServiceMethod.parseAnnotations(ServiceMethod.java:37)
            at retrofit2.Retrofit.loadServiceMethod(Retrofit.java:170)
            at retrofit2.Retrofit$1.invoke(Retrofit.java:149)
            at java.lang.reflect.Proxy.invoke(Proxy.java:913)
            at $Proxy0.getArtists(Unknown Source)
            at com.kevincianfarini.saddle.data.network.saddle.SaddleAPIManager.getArtists(SaddleAPIManager.kt:11)
            at com.kevincianfarini.saddle.data.repository.ArtistRepository$syncChannel$2.invokeSuspend(ArtistRepository.kt:28)
            at com.kevincianfarini.saddle.data.repository.ArtistRepository$syncChannel$2.invoke(Unknown Source:33)
            at com.kevincianfarini.saddle.data.repository.Repository$exhaustPagination$2$1.invokeSuspend(Repository.kt:41)
            at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    d
    j
    • 3
    • 29
  • d

    Drew Hamilton

    08/06/2019, 11:14 AM
    OkHttp 4.0.1 publishes a javadoc jar, but the jar only holds a MANIFEST.MF file, no actual javadocs or KDocs. Is this intentional? Why? (https://repo1.maven.org/maven2/com/squareup/okhttp3/okhttp/4.0.1/)
    j
    • 2
    • 2
  • i

    Ive Vasiljevic

    08/06/2019, 11:19 AM
    How can I expect from my server
    Response
    both String and JSON (for example if server Response is successful I can deserialize Response into my class fields and if it is unsuccessful I get plain String)
    g
    • 2
    • 1
  • j

    Jonas Bark

    08/12/2019, 6:51 AM
    Regarding kotlinpoet: Is there a way to change the formatting of the generated output? E.g. changing the amount of spaces for indention. I did not found a way to do that via google.
    y
    • 2
    • 2
  • j

    joshr

    08/14/2019, 8:40 PM
    and getting this error. i've googled a bit but i can't see what i'm doing wrong. (version 1.1.4)
    Untitled
    r
    • 2
    • 2
  • m

    myanmarking

    08/16/2019, 12:37 PM
    when using moshi codegen, it wont complain if i forget to annotate with
    @JsonClass(generateAdapter = true)
    . but i haven't got the relection-based dependency and it still works. does it mean, somehow, there's a transitive dependency on kotlin reflect ?
    l
    a
    • 3
    • 4
  • s

    Sergio Crespo Toubes

    08/21/2019, 4:38 PM
    Hello, with retrofit with coroutines what class is the response of a @post call?? Response? only for now the call have finished or its void function? thx.
    g
    • 2
    • 12
  • c

    Cody Engel

    08/26/2019, 6:05 PM
    SQLDelight question… Has anyone been able to successfully run
    generateSqlDelightSchema
    with version
    1.1.4
    ? It’s referenced in the readme but the task cannot be found, others have reported the issue without much traction so wondering if I’m missing something? https://github.com/square/sqldelight/issues/1400
    d
    t
    • 3
    • 5
  • j

    jw

    08/30/2019, 3:24 PM
    yes. only 2xx responses contain bodies of that type
    k
    c
    • 3
    • 8
  • j

    jw

    09/03/2019, 12:48 PM
    no
    f
    • 2
    • 1
  • a

    arekolek

    09/12/2019, 12:59 PM
    Let’s say you make an HTTP request, OkHttp caches it, the user changes system clock to be one day in the past, you try to do the same request again and all you get is the cached response. Is there anything you can do about it (while still relying on cache)?
    a
    l
    • 3
    • 6
  • e

    egorand

    09/17/2019, 11:05 AM
    It is there, you just have to import it manually: https://github.com/square/kotlinpoet/blob/master/kotlinpoet/src/main/java/com/squareup/kotlinpoet/MemberName.kt
    p
    • 2
    • 2
  • j

    jw

    09/19/2019, 3:02 PM
    intellij understands gradle without the android plugin
    d
    • 2
    • 1
  • c

    Casey Kulm

    09/19/2019, 6:54 PM
    Is adding many getters to a Dagger Component an anti-pattern (it feels like it is), and if so what should my thought process be to eliminate it?
    g
    • 2
    • 2
  • j

    jw

    09/23/2019, 7:39 PM
    I'm a bit skeptical whether we want to try and tease out a supertype from websocket that deals with read-only streams
    k
    • 2
    • 17
  • b

    bohsen

    09/24/2019, 12:49 PM
    With Dagger 2..24 is
    compilerArgumentProvider new EnableDaggerIncrementalAP()
    still needed in app build.gradle?
    r
    • 2
    • 1
  • r

    ribesg

    09/25/2019, 12:44 PM
    So I have a project with jvm and js targets so I’m forced to use multiplatform because you can’t seem to have jvm and js kotlin plugins in separate subprojects of the same project or something. Now, how do I use sqldelight just for one target?
    e
    • 2
    • 3
  • k

    kevin.cianfarini

    09/26/2019, 10:56 PM
    Really enjoyed this article about sqldelight views. Can't believe I haven't been leveraging this more https://leandrofavarin.com/sqldelight-powerful-codegen
    👍 4
    j
    • 2
    • 3
Powered by Linen
Title
k

kevin.cianfarini

09/26/2019, 10:56 PM
Really enjoyed this article about sqldelight views. Can't believe I haven't been leveraging this more https://leandrofavarin.com/sqldelight-powerful-codegen
👍 4
@jw can you describe how listening for changes on all tables involved in a view is implemented? I'm curious
j

jw

09/26/2019, 11:19 PM
The compiler parses all your SQL and sees that it depends on two tables. As a result, it code generates in such a way that both tables are observed.
👍 2
k

kevin.cianfarini

09/26/2019, 11:20 PM
Cool. Figured it might be in the compiler. Was poking around the runtime and wasn't seeing exactly what you described
View count: 3